SomeDude
SomeDude

Reputation: 14228

setting classpath in manifest.mf

Hi I have an eclipse application which has MANIFEST.MF in which I am trying to set classpath like

Class-Path:
 ./lib/*

where . is current directory and lib is the location where I have all my jars kept that are needed by the application. But it doesn't pick the jars.

But if I specify ./lib/library1.jar, it does pick the library1.jar I also tried .lib/library1.jar;./lib/library2.jar; etc. It doesn't work this way too.

How do I specify multiple jars in a classpath in MANIFEST.MF

Upvotes: 1

Views: 8625

Answers (2)

JonAar Livernois
JonAar Livernois

Reputation: 344

In jar manifest files, you don't use ';' to specify multiple files, you simply use whitespace. In addition you also don't want to use . to specify the current directory. The file paths should be specified to run from the current directory by not using any non-whitespace syntax at the start of the path.

Try modifying your Class-path entry to be

Class-Path: lib/library1.jar lib/library2.jar

Upvotes: 0

SomeDude
SomeDude

Reputation: 14228

I found the answer , the MANIFEST.MF is very picky in white spaces and lines The entry should be like this -( may be useful for someone ):

Class-Path: ./lib/library1.jar ./lib/library2.jar

no extra lines, only white spaces in between

Upvotes: 1

Related Questions