Hello everyone.
I have the following problem. I am sure that I am doing something very
silly, but I cannot figure out what it is.
I have the following structure for my Java application:
1) These are the directories I subdivided my code into:
../images
../sound
../libraries
../classes
and this is the main class
MAIN.class
'classes' contains the byte code of the program I wrote; 'libraries'
contains two .jar files that must be included in the classpath for my
application to run (actually to send e-mails). 'images' and 'sounds'
contain, respectively, images and sounds used in the application.
2) If I run the main class, the ./MAIN.class, from a normal shell everything
works fine (obviously setting the classpath).
3) If I package the classes in a .jar file, the application starts but:
- the two .jar files in libraries are not in the classpath causing the
application to receive an exception when trying to use classes in them;
- none of the files in the directories ./sound and ./images is
accessible. The relative path used in the various files in the 'classes'
directory, that is 'images/img1.jpg', works fine only if the class is not in
a .jar.
The .jar files has been created with the following command line:
jar cvfm mymanifest appl.jar MAIN.class classes libraries images sounds
where mymanifest is composed by the following lines:
Main-Class: MAIN
Class-Path: . libraries/mail.jar libraries/activation.jar
I do hope to find someone able and willing to help me.
Thank you in advance,
F.A. Cardillo