aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes How Can I Create a Runnable JAR File in Eclipse, Including Java Source Code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How Can I Create a Runnable JAR File in Eclipse, Including Java Source Code?" Watch "How Can I Create a Runnable JAR File in Eclipse, Including Java Source Code?" New topic
Author

How Can I Create a Runnable JAR File in Eclipse, Including Java Source Code?

Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

Hello,

I'm trying to create a runnable JAR file using Eclipse. I am successfully creating a runnable JAR, but I want to easily be able to include all of my source-code within the JAR. Now, when I look at the JAR files that I'm creating, they only have .class files in them.

Thank you for taking the time to read my question.

-- Kaydell
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
Here you go: File -> Export -> Java - JAR file, on the next screen check "Export java source files and resources"
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

If I go to:

File > Export > Jar

then I don't get a runnable JAR. I'm going to:

File > Export > Runnable Jar

and I don't have the option to include the source-code.

I guess that I'll have to do as you say and go to:

File > Export > Jar > and then choose to include the source-code, but then I guess I'd have to make my own manifest file so that the JAR is runnable.

Right?
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
Kaydell Leavitt wrote:
I guess that I'll have to do as you say and go to:

File > Export > Jar > and then choose to include the source-code, but then I guess I'd have to make my own manifest file so that the JAR is runnable.

Right?


I think you have not tried yourself, because on the next screen you will be instructed to create the manifest file as well as specifying the main class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Can I Create a Runnable JAR File in Eclipse, Including Java Source Code?
 
Similar Threads
creating jar file from eclipse
Exporting to jar file in eclipse
jar packaging
Ant - How to create a runnable jar of jars and classes
Where Do I Place My Resource Files So Eclipse Will Include Them in the Jar?