🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.java
1 messages
1 total messages Started by Wojciech Waga Sun, 08 Apr 2012 10:36
bsh
#153371
Author: Wojciech Waga
Date: Sun, 08 Apr 2012 10:36
83 lines
3152 bytes
Jest program do ściągania map z różnych serwisów - MOBile Atlas Creator 
w postaci pliku *.jar.

Program ten pozwala na dodawanie własnych map w formacie bsh. Problem 
jest w tym, że pliki bsh są wczytywane jak MOBAC działa na Windows, 
natomiast pod Linuksem dostaję komunikat:

... Class: Scriptable not found in namespace ...

Zrobiłem minimalne wersje tych skryptów i wyglądają tak:

aa.bsh

addClassPath("/usr/share/java/js.jar");

import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;

name = "aa";

Scriptable f()
{
}

return;




bb.bsh

import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;

name = "bb";

Scriptable f()
{
}

return;


Co ciekawe jak wpiszę w bashu:

bsh aa.bsh to przechodzi bez problemu, MOBAC z kolei wypisuje dla tego 
pliku:

ERROR - Failed to load custom BeanShell map source "aa.bsh": Sourced 
file: inline evaluation of: ``addClassPath("/usr/share/java/js.jar"); 
import org.mozilla.javascript.Context;  . . . '' : Command not found: 
addClassPath( java.lang.String )
Sourced file: inline evaluation of: 
``addClassPath("/usr/share/java/js.jar");  import 
org.mozilla.javascript.Context;  . . . '' : Command not found: 
addClassPath( java.lang.String ) : at Line: 1 : in file: inline 
evaluation of: ``addClassPath("/usr/share/java/js.jar");  import 
org.mozilla.javascript.Context;  . . . '' : addClassPath ( 
"/usr/share/java/js.jar" )

Dla drugiego pliku (bez addClassPath) bsh i MOBAC pokazują to samo:

ERROR - Failed to load custom BeanShell map source "bb.bsh": Sourced 
file: inline evaluation of: ``import org.mozilla.javascript.Context; 
import org.mozilla.javascript.Scriptable; . . . '' : Class: Scriptable 
not found in namespace
Sourced file: inline evaluation of: ``import 
org.mozilla.javascript.Context; import 
org.mozilla.javascript.Scriptable; . . . '' : Class: Scriptable not 
found in namespace : at Line: 6 : in file: inline evaluation of: 
``import org.mozilla.javascript.Context; import 
org.mozilla.javascript.Scriptable; . . . '' : Scriptable


Plik jar dostarczający klasę Scriptable jest w bieżącym katalogu i 
dodatkowo w katalogu z klasami systemowymi. Ustawienie CLASSPATH na 
niego zarówno w Shellu jak i java -cp ./js.jar -jat Mobac.jar też nie 
pomaga.

Czy ktoś ma jakiś pomysł jak to poprawić?

pozdr.
w.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads