简体   繁体   中英

How can i export a jar file with libraries in eclipse? (Not executable jar)

How can i export a jar file in eclipse with libraries? Executable jar wont work for me so that is out of the question. There is no option to do that when i try to export it..

If the jar is not running try to run it using a CLI for example command prompt java -jar <name>.jar and see the errors.

When you export the .jar there are 3 options .

  • One and two produces the .jar with the libraries inside.
  • Third option is producing a .jar (executable) with the libraries added a different folder[ which has the same name as the jar file and it must be named like it].

Mention that:

You may have serious problems and your executable will not run if your application has duplicate entries . So most of the time the third bullet is the best solution.

Sample image:

在此处输入图片说明


If you are trying to create a .jar to add it as a library to other projects then you should follow the below:

在此处输入图片说明

在此处输入图片说明

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