Catégories
Geek

single executable jar with dependencies

For my personal project oracle_sql ( which will allow me to export & import an oracle database to a .sql file ), i would have liked having an executable file ( a .jar in my case ) that doesn’t need any other files.

I tried to check the output of netbeans or eclipse, but they pass too many arguments to the java binary. Then I tried to create a manifest.mf to specify my classpath, but it doesn’t support jar inside jar. I tried to cheat using jar: syntax, but that’s a dead-end.

I finally found 2 projects to allow what I wanted :
One-Jar, which use a class loader,
and JarJar, which use bytecode transformations

I’ll have to watch how they work and choose the one I prefer.
If you have another solution, feel free to make a comment about it.

2 replies on “single executable jar with dependencies”

one-jar works great and is easy to use, jarjar need to use ant according to the site.
my choice is made

Laisser un commentaire

Concevoir un site comme celui-ci avec WordPress.com
Commencer