Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Advanced Scripting Environment (EASE) » Rhino resets the class path
Rhino resets the class path [message #1647575] Tue, 03 March 2015 13:55 Go to next message
Prabhat Kosuru is currently offline Prabhat KosuruFriend
Messages: 10
Registered: February 2015
Junior Member
I have noticed that Rhino is resetting the classpath of java somehow.
This creating a bit of problems to load & compile classes at runtime dynamically.. is there a way that we can prevent this ... ?

for example - when i run java and find the class path in eclipse via System.getProperty("java.class.path") i get the full class path.

But when executing a js using Rhino and call the same i get only - org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar to be in the class path ..

why is this so .. can we configure rhino settings to use the original class path ..

[Updated on: Tue, 03 March 2015 14:04]

Report message to a moderator

Re: Rhino resets the class path [message #1648021 is a reply to message #1647575] Tue, 03 March 2015 18:35 Go to previous messageGo to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
I am not aware that we are playing around with the classpath. Rhino uses the eclipse classloader and adds an URIClassloader on top to dynamically register jar files at runtime. But this should not affect a System.getProperty()

trying this out in js I get the same results as you. But if Iread the classpath in an Activator class, I also do only get the equinoy.launcher.
Sure that you get more than this from an eclipse plugin?
Re: Rhino resets the class path [message #1649304 is a reply to message #1648021] Wed, 04 March 2015 08:56 Go to previous messageGo to next message
Prabhat Kosuru is currently offline Prabhat KosuruFriend
Messages: 10
Registered: February 2015
Junior Member
running a main method in a class within a plugin gives me the complete class path.. (all jars that are available) but when i call java APIs using modules and just call "System.getProperty ..." in that method , i get only equinox.launcher..

can i configure rhino to add more jars to the classpath ? others too have faced such a problem .. but they have been working on the command line
Ps : http://workingrhino.blogspot.in/2007/10/getting-started.html
in the last line, why don't I just call java -jar .. ? Well, there's a little gotcha: if you do that, java will ignore the classpath you have so carefully set. You could work around that by using the -cp ${CLASSPATH} option to java, but I did it my way.
Re: Rhino resets the class path [message #1650560 is a reply to message #1649304] Wed, 04 March 2015 22:27 Go to previous message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
I tried again and still get the same short classpath when querying it from the ease.ui Activator. To make sure I gave it a second try and used a build with no Rhino bundles involved. Still the same result.
Classpath is .../.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar

Nothing more. So I am quite confident that rhino is not the problem here. I have no idea why your classpath looks different in some cases, though. If you still think this is a bug in EASE, please raise a bugreport and try to point me in the right direction. Currently I would not have the slightest idea how to help you on this topic.

For your second question: EASE supports the loadJar command natively that allows to attach jars to the *rhino* classpath dynamically. It seems a colleague of mie exerienced a problem with this mechanism for a dedicated library. So it is on my roadmap for next week to investigate this further.
Previous Topic:Can I create scripts that I can run inside the Eclipse Editor?
Next Topic:Start launch Config from script
Goto Forum:
  


Current Time: Fri Apr 19 07:01:28 GMT 2024

Powered by FUDForum. Page generated in 0.01828 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top