vfrj
vfrj

Reputation: 11

Class-path in manifest not read when running jar in Unix

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!

Upvotes: 1

Views: 1234

Answers (2)

ghostdog74
ghostdog74

Reputation: 342599

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"

Upvotes: 0

Eric Darchis
Eric Darchis

Reputation: 26707

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

Upvotes: 0

Related Questions