views:

139

answers:

3

Hi,

I have a client application that needs to run on Unix. It works fine in Windows but i get a NoClassDefFound exception in unix. Here's my manifest file:

Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By: 2.3 (IBM Corporation) Main-Class: com.main.Client Class-Path: lib/commons-lang-2.3.jar lib/commons-io-1.3.2.jar lib/comm ons-logging-api-1.1.jar lib/log4j-1.2.12.jar

And the Client.jar structure:

com com/main lib meta-inf

To run it, i use the command below:

$JAVA_HOME/jre/bin/java -jar Client.jar

It works fine in windows. Somehow i think that its not reading the manifest right. Help please! Thanks!

A: 

one way is to make sure you have defined your CLASSPATH variable for the user that is running the program.

$ echo $CLASSPATH

if there is nothing shown from the above, then export it

$ export CLASSPATH="/lib/commons-lang-2.3.jar:/your/other/paths"
ghostdog74
Thanks for the reply!But should'nt the Class-Path attribute in the manifest file handle that for me? What i want to have is a client application that is independent so that it can be ported to other machines.
vfrj
A: 

I've found the root of my error. Still working on it. Basically, the api that i'm using requires me to set a java property which points to a local folder. This causes the class path to look for the resources locally and not from within the jar. Well, this is what i've deduced so far..hehe. Thanks to all those that replied!!!

vfrj
A: 

Maybe because your meta-inf folder is in lower-case ?

Eric Darchis