I have compiled a Java project and implemented some functions such as database access, configuration file reading, and log record. In eclipse, it is okay to upgrade and run the test run, but it should be released to the server.
The project directory is as follows:
After checking the information, the process is as follows:
1. debug the project to ensure that the project has no error.
2. on the project, right-click Export ---> select JAR file under Java and click Next.
3. Select the entire project and select "export all output folders for check projects" in the check box. Fill in the jar name to be generated in export destination and click Next.
4. Click Next directly for the pakeging option.
5. Select mainclass. For example, if my project is serverstarter, click Finish to generate a jar file.
6. Install and run exe4j
7. Skip Step 1 directly
8. Select regular mode and click Next.
9. Enter the application name and selectCodeDirectory. For example, if my project is in H: \ myworkspace \ emessagesmsgate, I directly select this directory and the generated execution directory is the same by default. click Next.
10. Fill in the EXE name, select allow only a single running instance of application (the icon is not set), click Next
11. Add classpath. Here I add all the jar files and Lib directories generated just now. mainclass still selects serverstarter, click Next
12. Set the versions to 1.5 1.6 and click Next.
13. Click Next directly if you do not need to start the window.
14. The overall configuration is now available. You can directly click Next or finish to generate an EXE.
15. Copy the generated EXE, lib directory, conf directory, JAR file, and logs directory to your target machine and click EXE to run the program directly. (JDK is required for the target machine)
In view of the urgent functional requirements, the above steps are rough and you may not consider the meaning of each step in detail. The detailed work will be further considered later.