views:

487

answers:

3

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);
    }
A: 

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)
Rich
A: 

Please create a zipped version of a minimal workspace showing the behaviour and make it available.

Thorbjørn Ravn Andersen
+1  A: 

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.

Dieter
does Appletviewer support it?
Tom