Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to distribute a java-application with libraries such as itext?

I have written an application in java. It uses iText, jXL and JAI.

How do I build a jar which contains all these libraries? Or do I have to force the user to install these too?

like image 881
Sven Avatar asked Nov 29 '25 08:11

Sven


1 Answers

Either unpack the jars into your jar, or just add them to the jar classpath via the Class-Path attribute in your meta-inf, and distribute the libraries along with your main jar. Sample META_INF/Manifest.mf:

Manifest-Version: 1.0
Class-Path: itext.jar jxl.jar jai.jar
Main-Class: com.xxx.yyy.Main
like image 54
Denis Tulskiy Avatar answered Nov 30 '25 20:11

Denis Tulskiy