We help IT Professionals succeed at work.

JAVA: How do I set ECLIPSE to automatically create a JAR file for my application?

oxygen_728 asked
Last Modified: 2013-12-29

I have a medium-complexity project with a few applications within it.

I have successfully created a JAR file on my desktop that I can run with java -jar AppC.jar

I created the JAR by right clicking on my project and choosing to export.

I would like this to occur automatically everytime I build the project, so that I don't have to spend the time to go through the menus myself.

Note: My reason for doing this is because running the app from the eclipse IDE is worthless to me, I need the command line

Thanks for your time

Watch Question

I'd suggest writing an ant script that builds your project and creates a JAR from it.
you can then use this build script from eclipse.

more on ant:


Can you recommend a good tutorial on how to set one up?

This one is on us!
(Get your first solution completely free - no credit card required)


Thanks, I'll get to that soon!
Top Expert 2016

If you're not committed to Eclipse, i'd recommend using Netbeans. It integrates completely with Ant and in fact does what you require by default anyway


I think that is wise advice CEHJ -- After using eclipse for two months, I'm starting to think that the only people who recommend it are the people who develop it.

I can say very few good things about it.

Top Expert 2016

Well actually when i recommend N over E here i usually find myself in a minority of one ;-) Having used both, i find the main reason for preferring the former is actually the Ant thing.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.