Luigi said:
Hi,
in my application there are several import from an external library, in
Eclipse i've added this library in Project -> Properties -> Java Build
Path -> Add External JARs.
Well, when i export as a Jar file this "jade.jar" library is not in my jar
file and the application cannot run.
I've tried even to manually modify the manifest.mf file adding the row:
Class-Path: jade.jar (adding even the file in the jar)... but this is not a
solution
Is there a solution?
here's some stuff I did a while back:
[thufir@arrakis bin]$
[thufir@arrakis bin]$
[thufir@arrakis bin]$ date
Tue Aug 2 08:56:50 IST 2005
[thufir@arrakis bin]$ ll
total 16
-rw-rw-r-- 1 thufir thufir 2511 Aug 2 08:49 ControlTidy.jar
drwxrwxr-x 2 thufir thufir 4096 Aug 2 08:55 lib
[thufir@arrakis bin]$ ll lib/
total 156
-rw-rw-r-- 1 thufir thufir 147859 Aug 2 08:54 Tidy.jar
[thufir@arrakis bin]$ jar -tf ControlTidy.jar
META-INF/
META-INF/MANIFEST.MF
atreides/
atreides/tidyXhtml/
atreides/tidyXhtml/BasicTidy.class
atreides/tidyXhtml/ControlTidy.class
atreides/tidyXhtml/Test16.class
[thufir@arrakis bin]$ jar -xf ControlTidy.jar
[thufir@arrakis bin]$ ll
total 32
drwxrwxr-x 3 thufir thufir 4096 Aug 2 08:57 atreides
-rw-rw-r-- 1 thufir thufir 2511 Aug 2 08:49 ControlTidy.jar
drwxrwxr-x 2 thufir thufir 4096 Aug 2 08:55 lib
drwxrwxr-x 2 thufir thufir 4096 Aug 2 08:57 META-INF
[thufir@arrakis bin]$ cat META-INF/MANIFEST.MF -n
1 Manifest-Version: 1.0
2 Ant-Version: Apache Ant 1.6.4
3 Created-By: 1.5.0_02-b09 (Sun Microsystems Inc.)
4 Main-Class: atreides.tidyXhtml.ControlTidy
5 Built-on: 2005-08-02T08:49:14
6 Class-Path: lib/Tidy.jar
7
[thufir@arrakis bin]$ java -jar ControlTidy.jar
[thufir@arrakis bin]$ ll
total 100
drwxrwxr-x 3 thufir thufir 4096 Aug 2 08:57 atreides
-rw-rw-r-- 1 thufir thufir 2511 Aug 2 08:49 ControlTidy.jar
-rw-rw-r-- 1 thufir thufir 16083 Aug 2 08:58 err.txt
drwxrwxr-x 2 thufir thufir 4096 Aug 2 08:55 lib
drwxrwxr-x 2 thufir thufir 4096 Aug 2 08:57 META-INF
-rw-rw-r-- 1 thufir thufir 42366 Aug 2 08:58 out.txt
[thufir@arrakis bin]$ date
Tue Aug 2 08:58:09 IST 2005
[thufir@arrakis bin]$
Note line 4 of the manifest, sets the Main-Class and line 6, which sets
the class-path for a needed external jar file.
As to editing a manifest manually, I'd use Ant to do that automagically
instead.
HTH,
Thufir