Package and release a Java Project

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.