开发者

How to use One-Jar?

开发者 https://www.devze.com 2023-04-04 10:40 出处:网络
I\'ve coded an aplication that it\'s used to process a set of files. From each file it extracts an xml file and gets info. At the end an excell file is created containing the info extracted from each

I've coded an aplication that it's used to process a set of files. From each file it extracts an xml file and gets info. At the end an excell file is created containing the info extracted from each file.

It works perfectly when I run it from eclipse, but when I try to create a jar file and run it we start finding problems..

I had to add jars to work with xml files and to create excell files, I just learned that this is not supported. I started then to look into how to create a jar file that contains others jar files. I found this http://one-jar.sourceforge.net/index.php?page=getti开发者_JAVA技巧ng-started&file=quickstart

(Command-Line Approach)

In step 2, I created a jar file containing all the classes I've coded. Is that right?, in the lib folder I copied al the external jars I use

After executing the last step all I get is a 1Kb one-jar.jar file.

Could anyone help me with this?

Thanks for reading all this!


Most likely you omitted the dot at the end of the command line in the last step:

cd root; jar -cvfm ../one-jar.jar boot-manifest.mf .<---- This matters!

It tells the JAR tool what to include in the archive (the current directory). Without it, the JAR tool creates an archive that is empty except for the manifest.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号