• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here you go: File -> Export -> Java - JAR file, on the next screen check "Export java source files and resources"
 
Kaydell Leavitt
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
reply
    Bookmark Topic Watch Topic
  • New Topic