Since today, I cannot access netscape.javascript.* classes within Eclipse

亡梦爱人 提交于 2020-07-09 01:09:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!