Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem with JAR files

Thread Tools

Problem with JAR files

11marini 11marini is offline
Junior Member
Join Date: Dec 2008
Posts: 1
Hello all,

I'm trying to create a patching system, and I'm having some troubles. Let me describe it to you.

The initial setup of the system: Several JAR files that basically split up one source tree. One JAR has the driver code (we'll call it driver.jar), one holds some config files (config.jar), and one holds other classes that are loaded by the driver file (other.jar). Think of it like a program that gives you a choice of small java-based games. The code for the chooser program is in driver.jar, and the code for each of the games are in other.jar. Hopefully this is clear.

Now a problem arises. Say one of the games has a bug. The idea is to patch it using an additional jar file (called patch.jar) that holds a corrected version of the faulty code. My hope was that by putting it in the correct place in the classpath, it would pick up the code inside the patch INSTEAD of the code in other.jar. You could also add games by including them in the patch, and the chooser program would pick it up.

This aspect of adding games works perfectly, just fixing old ones is presenting problems.

Here are some example class paths:

Classpath for driver.jar:
..\lib\patch.jar ..\lib\config.jar ..\lib\other.jar

Classpath for config.jar:
Blank because it's only accessed, it doesn't access anything else (just holds .properties files)

Classpath for other.jar:
..\lib\patch.jar ..\lib\driver.jar ..\lib\config.jar

Classpath for patch.jar:
..\lib\driver.jar ..\lib\config.jar ..\lib\other.jar

What I have tried so far:
--> Changing the classpath of patch.jar in any way seems to have no effect.
--> Moving the patch to the end of the classpath of the other two files seems to have no effect.

Thoughts on a solution. Or does anyone know a way to debug the execution of this so I can see how it picks which class to load (I guess that would be debugging the VM)?

Thanks in advance for your help.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
java -cp a.jar -jar b.jar => Works on Windows, not on Debian cyberco Java 4 02-14-2006 06:27 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters XML 0 01-05-2005 10:59 PM
Jar files in Jar files Eric McIntyre Java 1 05-24-2004 07:24 PM