Search code examples
javajavascripteclipserhino

How set classpath for Rhino debugger plugin in Eclipse?


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?


Solution

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