classpath

Inside a directory named "application" I have a jar file "test.jar" and another directory named "config". My class inside the jar loads a file config.xml from classpath. The config.xml is present inside the "config" directory. I have added 'Class-Path=. ./ config' to the jar manifest. When I run my class inside the jar as 'java -classpath test.jar Test' it throws Exception, File not found in the classpath. But if I run it like 'java -classpathconfig;test.jar Test' it is successful.

Please help me to understand this behaviour.

[559 byte] By [mod_pa] at [2007-11-27 9:38:25]
# 1

The classpath in the jar manifest file has no effect if the jar is not executed with the java -jar command. The classpath on the command line or set in the environment variable CLASSPATH has no effect if the jar file is executed with the java -jar command; only the one in the manifest is used.

In fact, all the classpath options (manifest file, CLASSPATH and -classpath) are mutually exclusive.

sabre150a at 2007-7-12 23:11:45 > top of Java-index,Java Essentials,Java Programming...
# 2
I have a dependent jar util.jar to Test.jar which is under a "lib" directory at same level as "config". I have added 'lib/util.jar' in the manifest and it is working. Where as it is not working for the config files. This does not show mutual exclusion. I am not sure though.
mod_pa at 2007-7-12 23:11:45 > top of Java-index,Java Essentials,Java Programming...
# 3
I don't think I am wrong about the mutual exclusion though I could be. From what you have just posted I can't visualize your setup and without this visualization I don't think I can help.
sabre150a at 2007-7-12 23:11:45 > top of Java-index,Java Essentials,Java Programming...