Problem with JAR files

Discussion in 'Java' started by 11marini, Dec 31, 2008.

  1. 11marini

    11marini

    Joined:
    Dec 31, 2008
    Messages:
    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.
     
    11marini, Dec 31, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric McIntyre

    Jar files in Jar files

    Eric McIntyre, May 24, 2004, in forum: Java
    Replies:
    1
    Views:
    496
    Roedy Green
    May 24, 2004
  2. Arnold Peters
    Replies:
    0
    Views:
    614
    Arnold Peters
    Jan 5, 2005
  3. muttley
    Replies:
    0
    Views:
    2,767
    muttley
    Oct 20, 2005
  4. cyberco
    Replies:
    4
    Views:
    3,847
    Roedy Green
    Feb 14, 2006
  5. Arnold Peters
    Replies:
    0
    Views:
    690
    Arnold Peters
    Jan 5, 2005
Loading...

Share This Page