Implementation of java files on Linux - Java source code generation Eclipse executable file

1. Operating Environment

1.Linux:centos7 

2.eclipse

3. java environment installed on many online tutorials, readers can search on their own linux, the lazy use the built-in on linux

About the strengths and weaknesses of both the subsequent comparison

Packet generation 2.jar

With the eclipse to do a web automated testing project, when they used is actually very easy to use, open the eclipse can be run directly, but when other small partners to share with the less convenient, hoping to generate an executable file, others when using, you can run directly. Practice a little, record the steps.

1. The file must have the main function, as follows:

 

2. Select the file with the main function or method is selected in the left main menu list eclipse, right-export, find Runnable JAR file

Next, select the drop-down to select the Launch configuration "main" method entry class, and then set the export file path, click Browse, enter "* .jar" name, click on "Finsh" runnable jar to complete the production.

 

3. The resulting jar file on any disk, the disk such as E, type cmd run, the command window to switch to disk F, then: before java -jar event_timeline.jar, the script can be run automatically, enter ctrl + c to stop the script. (Java -jar jar file)

 On 4.Linux run as above, the package file upload jar rz command on linux, execute commands (running on Linux is critical to ensure that java environment)

 

 

 Thank big brother part from https://blog.csdn.net/qq_15158911/article/details/54411979 share!

Guess you like

Origin www.cnblogs.com/SI0301/p/11263893.html