0

I know how to make an executable Jar file in Eclipse. but if I want to add *.java files in the jar file, (when I want to CREATE a jar file), are there any good ways?

or do I need to add them after Eclipse creates a jar file?

kensuke1984
  • 949
  • 1
  • 11
  • 21
  • 5
    possible duplicate http://stackoverflow.com/questions/15180411/attach-the-source-in-eclipse-of-a-jar – Siva Jan 14 '16 at 05:56
  • 1
    Attaching an source file in eclipse is not possible. Generally executable jar needs only class files not source files... – Shriram Jan 14 '16 at 05:57
  • 1
    Not a duplicate of [Attach the Source in Eclipse of a jar](http://stackoverflow.com/q/15180411) - that one asks about debugging, this one asks about distribution. – Basilevs Jan 14 '16 at 14:32
  • Thank you, all. Shriram I will add by myself. I know a jar file run without source codes, but.... the users of my jar want me to show its source codes too. thats why..I asked if it is possible to add them into jar and then they can follow the link by @Siva Thank you for the comment! Basilevs – kensuke1984 Jan 15 '16 at 09:50
  • It sounds like you're really getting into territory where an automation tool such as Maven is worth learning rather than doing things by hand. – chrylis -cautiouslyoptimistic- Jan 15 '16 at 10:06
  • 1
    Eclipse's "export runnable jar" dialog has an option which also prepares an ant task that prepares a runnable jar file. You can then modify ant script to also export source files – guleryuz Jan 15 '16 at 19:04

0 Answers0