Java projects are made into jar packages and deployed to Linux servers, and Java programs are started in shell scripts

Source: Internet
Author: User

First, in Eclipse, the Java program is made into a runnable jar package

1. Simply package the SRC directory and the third-party jar in the Lib directory

  

2. After selecting these two positions, "next", then "Finish", generate the Jar package

3. Build a ZIP package for the project structure

Then, the project into a zip package, note that only the required program directory structure and configuration folder can be

4. Click "Finish" to complete the ZIP package compression

5, the generated jar package and zip package upload to the Linux Server program installation directory (depending on the project group, the program installation directory will be different, but generally in the/usr directory),

Unzip the ZIP package and place the jar package in the extracted Lib folder

6. Write a shell program to invoke the jar package and launch the application

For example:

App_home=jar Package Path

App_mainclass= program main class full package path

Classpath=${app_home}/lib/xxx.jar:sss.jar

java-xmx3000m-xms3000m-server-d64-dfile.encoding=utf-8-dfetch.threads=300-classpath $CLASSPATH ${APP_ MAINCLASS} $ $

Java projects are made into jar packages and deployed to Linux servers, and Java programs are started in shell scripts

Related Article

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.