Link to home
Start Free TrialLog in
Avatar of steve_bagnall
steve_bagnall

asked on

jt400.jar not found when packaged in jar

I have an executable jar file with jt400.jar packaged within it.  I can run this application on the server where it is to be deployed and I get a "java.lang.NoClassDefFoundError: com/ibm/as400/access/AS400JDBCDriver" exception (AS400JDBCDriver is a class within jt400.jar).  However, when I run this on my development machine I get no such error.  It seems that this is because there is another copy of JT400.jar on that machine and it has an entry in the CLASSPATH. Without modifying the classpath of the target machine, how do I make sure that the class files packaged within a jar packaged within another jar can be seen, if you see what I mean?

Cheers Steve.
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

It may be easier to just put jt400.jar with (not inside -- just in the same folder) your other jar, and add:

Class-Path: jt400.jar

to your manifest?
Avatar of steve_bagnall
steve_bagnall

ASKER

It maybe in this case, but I am deplying this using WebStart so I would like the whole application to be in one jar file.  Are you saying this is not possible?

Cheers,
Steve
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tim,

Will I still need to modify the manifest file doing it this way?
I don't believe so...

(I may be wrong, but I really don't believe so)...

:-/

We're on the fringes of my knowledge here ;-)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What would you recommend objects?  (you're knowledge of JWS is probably greater than mine)...

Seperate jars with jt400 defined in the resources block of the jnlp file, or a single combined jar?
Tim,  I used your solution, and objects looks interesting so I split the points.  Hope everyone's OK with that :)

Cheers,
Steve

p.s it works at last! :)
no worries :-)

>> p.s it works at last! :)

Yay!! :-D

Good luck!

Tim