Saturday, 20 December 2014

How to create jar and run from command line

In order to create runnable jar,You need to do following steps in Eclipse:

1) Right Click on your project.Select Export Option and then Select Runnable Jar File Option.

2) After Clicking Next, select the main class of your project in Launch configuration and Specify the path and name of jar file in Export destination.

3) Click Finish.

To Run Jar File,Follow the steps mentioned below:

1) Make Sure java path is set in Environment variable.
2) Open command Line
3) Go to path where Jar is generated. in this case : cd f:/aapps/
4) Run java -jar Test.jar

No comments:

Post a Comment