How to distribute java application with libraries like itext?

I wrote an application in java. He uses iText, jXLand JAI.

How to create a jar that contains all these libraries? Or do I need to force the user to install them as well?

+3
source share
5 answers

Either unpack the jars into the jar, or simply add them to the jar class path using the Class-Path attribute in the meta-inf, and distribute the libraries along with your main jar. Example META_INF / Manifest.mf:

Manifest-Version: 1.0
Class-Path: itext.jar jxl.jar jai.jar
Main-Class: com.xxx.yyy.Main
+4
source

Ant. NetBeans, , NetBeans, .

0

You can use a utility like jarjar to merge your classes and other libraries into a single deployment file.

0
source

Thanks for all the solutions!

Fatjar is a great plugin for Eclipse that does all this too (:

0
source

Source: https://habr.com/ru/post/1777686/


All Articles