Problem with JAR files

Joined
Dec 31, 2008
Messages
1
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top