Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

URLClassLoader works in linux but not windows?

843829Mar 10 2006 — edited Mar 11 2006
All,
I am struggling with a problem I can not seem to find a solution for. I hope someone else can see something I am missing.
I have some code:
jarFile = new File("somejarfile.jar");
scriptName = new String("scriptToLoad");
ClassLoader loader = new java.net.URLClassLoader(new URL[] { jarFile.toURL() } );
Class scriptClass = loader.loadClass(scriptName);
ScriptTemplate script = (ScriptTemplate) scriptClass.newInstance();
This works fine in my unix environment(ver 1.5.0_03-b07 Linux), but when I try to run it in Windows(ver 1.5.0_06-b05 XP), I get a ClassNotFoundException, from URLClassLoader.java:200
I suspect that something is wrong with my environment/security/path/os/fingers/god
Can anyone tell me what to check next?
This does not seem that unusual a thing to do with a URLClassLoader, and the fact that it works fine on unix, but not windows is guiding me to some strange environment or security issue I am just not familiar with, but someone else may be able to recognize from the description.
Thanks in advance for any help, John
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2006
Added on Mar 10 2006
5 comments
643 views