Create a new Java project (the project in this example is called javaproject) and write the method you want to execute in main ().
Next, the project is directed into a jar package, the following steps:
Right-click the project name, select Export, select the Java runnable JAR file (e.g.)
After clicking Next, select your project name (class name-project name) in the pop-up box and select the location of the jar package upload (e.g.:)
Click on the Finish button to generate, double-click the generated jar package to run.
How to run the jar package with a. bat file Next:
Create a new Run.bat file (the filename is named), open it in Notepad, enter it (Java-jar + (the path and name of the jar package)):
Java-jar Run.jar
Once saved, you can run the jar package by double-clicking on the Run.bat file.
If you want to see the output information for the Run.bat runtime, you can add pause later:
Java-jar Run.jarpause
This will allow you to see the information printed at run time.
Java engineering into JAR packages, running jar packages with batch processing