Cody
Cody

Reputation: 890

Java Jar within a Jar

Im trying to make my jar load a driver that will be stored inside it. Is this possible without having the user download any additional programs. I've read on another post about One-Jar but I'm not sure I understand how it works. Will The user have to download one-jar too?

I downloaded one-jar but when I run it nothing happens :S. Am I missing something?

Upvotes: 1

Views: 227

Answers (2)

thait84
thait84

Reputation: 198

Use the Maven Assembly Plugin:

http://maven.apache.org/plugins/maven-assembly-plugin/

And build with the descriptor "jar-with-dependencies"

http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies

It is pretty easy.

Upvotes: 0

BillMan
BillMan

Reputation: 9934

You can also create a shell script to append all the jars in a directory to your classpath.

Upvotes: 1

Related Questions