简体   繁体   中英

How to use One-Jar?

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=getting-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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM