-4

I am familiar with two ways to create JAR

1)Use Eclipse and export Runnable JAR - quick and easy

2) Use JarOutputStream . In addition i have to specify manifest , make sure to include all third parties API that I used in my project . These complicated the code .

The advantage of the second method is that it's done programmatically .

I am curious is there any API that would generate JAR as easy as Eclipse does ?

JarFile jarFile = new JarFile ("C:\\ ... myProjectFolder") 
CHEBURASHKA
  • 1,623
  • 11
  • 53
  • 85
  • 6
    Are you familiar with the [`jar` command?](http://docs.oracle.com/javase/tutorial/deployment/jar/build.html) – vandale Mar 14 '14 at 00:57
  • Even though it may not look that way, doing those stuff on command line is very easy – Engin Kayraklioglu Mar 14 '14 at 00:58
  • You may also find some useful information here: http://stackoverflow.com/questions/81260/easiest-way-to-merge-a-release-into-one-jar-file?rq=1 – Jason C Mar 14 '14 at 01:01
  • What about learning Maven? Definitely will come handy in the future. http://maven.apache.org/ – Robert Balent Mar 14 '14 at 01:09
  • Using a command line build tool (ant, maven, gradle, and others) will also let you play nicely with dependency management and continuos integration systems. All big pluses. –  Mar 14 '14 at 01:16
  • What is difficult with method 1? – Mukus Mar 14 '14 at 03:10

1 Answers1

2

Sounds like you might want a build scripting tool. Popular choices include Ant and Maven. I personally like a newer option called Buck.

Isaac Truett
  • 8,734
  • 1
  • 29
  • 48