How set classpath for Rhino debugger plugin in Eclipse?

坚强是说给别人听的谎言 提交于 2019-12-20 07:47:38

问题


Actually I am using the Rhino plugin in Eclipse. To use a Java class in JavaScript there is no problem when I just use class which is in RT.JAR.

But whenever I want to use my class' "custom classes" then the problem begins due to the classpath.

Steps made by me

  1. make a class and put it into a JAR file.
  2. add it 'jar' into an external JAR file in Eclipse.
  3. use it into a JavaScript file and debug it as Rhino debugger in Eclipse.
  4. error due to class not defined, "Due to class path is not set properly".

The error

js: uncaught JavaScript runtime exception: ReferenceError: "Temp" is not defined.

JavaScript file

importPackage(java.lang);  
importPackage(Packages.my);  
var a=new Temp();  
System.out.println(java.lang.System.getProperty("java.class.path"));

My view :-

  1. in the Rhino debugger configuration there are only two or three variables, like ECLIPSE_HOME, JRE_LIB, JRE_ext. So only the value of these variables are used by the Rhino debugger.
  2. then print value of classpath by using the Systemclass function, and then only print the classpath of the Rhino JAR file which is in the Eclipse/plugin folder.

Now, what should I do?


回答1:


The problem has been solved. The edited source of Rhino is uploaded back to Eclipse, so soon it may be the part of Eclipse.



来源:https://stackoverflow.com/questions/7471093/how-set-classpath-for-rhino-debugger-plugin-in-eclipse

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