• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make executable jar file with library jar files?

 
Hydrian Metanroid
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21419
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic