← Back to team overview

openjdk team mailing list archive

[Bug 255149] [NEW] OpenJDK doesn't respect classpath or overriding jar files

 

Public bug reported:

I'm trying to run a custom rhino to build Dojo, but OpenJDK keeps
ignoring the rhino in the jar file I provide and keeps loading rhino
from the system libs:

$ java -verbose:class -jar ../shrinksafe/custom_rhino.jar
...
[Opened /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.Main from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.ContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.ShellContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
...

If I specify a classpath, it still loads from the system rhino library:

$ java -classpath ../shrinksafe/ -verbose:class -jar ../shrinksafe/custom_rhino.jar
...
[Opened /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.Main from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.ContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.ShellContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
...

If I change over to using sun's JRE, it works fine:

$ sudo update-java-alternatives --set java-6-sun
$ java -verbose:class -jar ../shrinksafe/custom_rhino.jar
...
[Loaded org.mozilla.javascript.tools.shell.Main from file:/home/bryan/bzr/dojo/util/shrinksafe/custom_rhino.jar]
[Loaded org.mozilla.javascript.RhinoException from file:/home/bryan/bzr/dojo/util/shrinksafe/custom_rhino.jar]
[Loaded org.mozilla.javascript.EvaluatorException from file:/home/bryan/bzr/dojo/util/shrinksafe/custom_rhino.jar]
...

** Affects: openjdk-6 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
OpenJDK doesn't respect classpath or overriding jar files
https://bugs.launchpad.net/bugs/255149
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-6 in ubuntu.

Status in “openjdk-6” source package in Ubuntu: New

Bug description:
I'm trying to run a custom rhino to build Dojo, but OpenJDK keeps ignoring the rhino in the jar file I provide and keeps loading rhino from the system libs:

$ java -verbose:class -jar ../shrinksafe/custom_rhino.jar
...
[Opened /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.Main from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.ContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.ShellContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
...

If I specify a classpath, it still loads from the system rhino library:

$ java -classpath ../shrinksafe/ -verbose:class -jar ../shrinksafe/custom_rhino.jar
...
[Opened /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.Main from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.ContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
[Loaded org.mozilla.javascript.tools.shell.ShellContextFactory from /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar]
...

If I change over to using sun's JRE, it works fine:

$ sudo update-java-alternatives --set java-6-sun
$ java -verbose:class -jar ../shrinksafe/custom_rhino.jar
...
[Loaded org.mozilla.javascript.tools.shell.Main from file:/home/bryan/bzr/dojo/util/shrinksafe/custom_rhino.jar]
[Loaded org.mozilla.javascript.RhinoException from file:/home/bryan/bzr/dojo/util/shrinksafe/custom_rhino.jar]
[Loaded org.mozilla.javascript.EvaluatorException from file:/home/bryan/bzr/dojo/util/shrinksafe/custom_rhino.jar]
...



Follow ups

References