jar and exeternal file to load into classpath

J

Jacek

Hi,
I have a problem of popular nature:) I am tring to make my app
independen on system environment. I create a Jar file for my app, there
are also another Jars files (as libs):
Direcotry structure looks like this:
/
/libs
|
|__jconfig.jar
/configs
|
|__config.xml
JavaApplication2.jar - this is mine

manifest in JavaApplication2.jar looks like this

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.5.0-b64 (Sun Microsystems Inc.)
Main-Class: javaapplication2.Main
X-COMMENT: Main-Class will be added automatically by build
Class-Path: libs/jconfig.jar configs/config.xml

When I try to run app
java -jar JavaApplication2.jar it work and as it depends on
jconfig.jar it is properly declared in manifest. But it can not
find config.xml file. I don't know why. As a point i will tell you
that jconfig.jar looks by default for config.xml in classpath.
This is automated process i give no path in my program to config.xml.
I try to put config.xml to lib to / dir It doesn't matter :(
Please help
Jacek Balcerki
 
F

Ferenc Hechler

Hi Jacek,

try the following Class-Path:

Class-Path: libs/jconfig.jar configs

instead of:

Class-Path: libs/jconfig.jar configs/config.xml


bye,

feri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,779
Messages
2,569,606
Members
45,239
Latest member
Alex Young

Latest Threads

Top