Pages

Friday, 27 November 2020

Create Runnable JAR File And Run It By CMD

How To Create A Runnable JAR File And Run This JAR File By Command Prompt.

step 1: Runnable jar file.

step 2: Run jar file by command prompt.


Runnable jar file

1.    Right click on project

2.    Select Export


3.    Click java folder

4.    Choose runnable jar file

5.    Click Next.


6.    Select Main class in Launch Configuration.

Here we need to select the class in which main method of the selected project exist.

7.    Select the project folder of workspace in the export destination.

We can select another location also. But project folder recommended

8.    Give name to the jar file.

Here mySchedule name is given.

9.    Click Finish.




10.  Here we can see jar file is created in the project folder, that is MySchedule.



11.    Here you can just double click on mySchedule.jar file to run this project.

Run jar file by cmd

1.  Open Command Prompt

2.    Go to the file location

3.   Run Command:

      java -jar mySchadule.jar

4.   Put you file name.




1.  Here you can see your project is running properly.



-- Thanks --

No comments:

Post a Comment

Deploy Your Code To Heroku App

GitHub To Heroku Node.js To Heroku  1. HOW TO DEPLOY AN APP TO HEROKU FROM GITHUB