Create Jar Ant Build Hello World

Create Jar Ant Build Hello World

In this demo you will see how to create and run jar file using ant build file. We will print Hello World on the console to test it.

  • Sample project structure:

Create Jar Ant Build Hello World

  • HelloBean.java class:

  • HelloWorld.java:

  • build.xml file:

  • To run build to create and run jar file: Right click build.xml –> Run As –> Ant Build you will see below output with Hello World printed on the console:

Create Jar Ant Build Hello World

 

  • To run jar from command line please use below command:

Create Jar Ant Build Hello World

download Download Project: HelloWorldJar

For more information about ant build please refer Apache ant here

Leave a Reply

Your email address will not be published. Required fields are marked *