This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
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 JavaScript Promises Essentials this week in the JavaScript 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: 689

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: 689

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.
 
wood burning stoves
 
subject: How Can I Create a Runnable JAR File in Eclipse, Including Java Source Code?