wood burning stoves*
The moose likes Beginning Java and the fly likes how to make executable jar file with library jar files? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to make executable jar file with library jar files?" Watch "how to make executable jar file with library jar files?" New topic
Author

how to make executable jar file with library jar files?

Hydrian Metanroid
Greenhorn

Joined: Apr 13, 2008
Posts: 4
Hello,

I want to make a executable jar file with my java sources.

But it's using some library jar files(like commons or etc.)

and I want to make all in one jar file.

Is there any way to make it?
or am I have to write manifest file?

ps. I'm using eclipse, is there easy way to make it with eclipse?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18545
    
  40

I want to make a executable jar file with my java sources.

But it's using some library jar files(like commons or etc.)

and I want to make all in one jar file.

Is there any way to make it?
or am I have to write manifest file?


If you use a manifest, you can specify a class path to point to all the other jar files. However, this won't include the other jar files, you need to have the support jar files when you run it.

If you want it as one jar file, you have to extract all the jar files to one location, and jar it all up as one jar file. This is highly *not* recommended.

ps. I'm using eclipse, is there easy way to make it with eclipse?


Eclipse has the wizards to create the manifests and Jar file for you. I don't think that it will merge jar files though.

Henry
[ November 05, 2008: Message edited by: Henry Wong ]

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make executable jar file with library jar files?
 
Similar Threads
Eclipse Executable Builder
Creating .jar files (preferably in Eclipse) and adding existing .jar files to them
bundling images in a jar
Ragarding manifest.mf
Eclipse and Javadoc