Reputation: 165
Is there any way to load a jar file BEFORE a system jar? I have a class that is newer than the one in the java system (1.5) that I am forced to use, but it breaks because java loads it's own first (from rt.jar, to be specific). Is there some way I can force it to load my own jar BEFORE system/rt.jar?
Upvotes: 2
Views: 1207
Reputation: 80623
What you want is the (JVM specific) startup option -Xbootclasspath:/p
. This will prepend the supplied list of paths and archives before the existing boot classpath, forcing any classes found to be loaded first.
java -Xbootclasspath/p:<pathtooverridejarhere> mypackage.MyClass
Note that:
Upvotes: 3