问题
Since today, my Eclipse fails to load JSObject
. This code was previously working OK. Any ideas how to fix it? I do have simple netscape.jar
in the classpath.
Here is the code that now fails to work:
import netscape.javascript.*;
...
try {
doc = (JSObject) JSObject.getWindow(app); //.getMember("document");
} catch(JSException e) {
doc = null;
Debug.error("DBscorm().<init>: Exception " + e);
throw(e);
} catch(Exception e){
doc = null;
Debug.error("DBscorm().<init>: Exception " + e);
throw(e);
}
回答1:
In every JDK subfolder is a file called plugin.jar
Get this file and add it to your Eclipse classpath. This will make it work - guaranteed.
回答2:
A couple of possibilities:
- Do you have a missing import statement? Try organising imports with CTRL+SHIFT+O
- Is the netscape.jar still configured as a library for the project? (Project Properties->Java Build Path->Libraries tab, then click on "Add JARs..." if necessary)
来源:https://stackoverflow.com/questions/751428/since-today-i-cannot-access-netscape-javascript-classes-within-eclipse