The things that the jar packages upload to the server side

Source: Internet
Author: User

As a downright rookie, recently need to run the code on the server, the worry is really a lot of things.
After writing the code locally, it has to be packaged and uploaded to the server. The question comes, so what about the third-party jar package?
Either hit the runnable jar bag, each time the package is big, upload efficiency is too low. If there's a lot of code in that kind of bug, that's enough trouble. It is also possible to change the value of the Classpath in the profile (Linux system) by either hitting the normal jar package, not including the third-party package, and then modifying the classpath if there is a lot of jar packages for the third party.
So, the way I use it,
1. The first time you pack the jar package into runnable (you need to specify MainClass), so that the project needs the jar package is included in the jar package, such as the generation of A.jar, upload the jar to the server, you can run directly, you can use the command:

Java  A.jar

(I feel like it is inconvenient, if you need to execute multiple classes at the same time, but runnable can only specify a mainclass, what to do?) )
2. Upload the compiled class file (folder) to the server and execute the class test using the following command:

JAVA-CP A.jar TEST-CP Specifies that the classpath is a previously packaged jar package, so that the required class can be found in the jar package. Test is the main class to execute

  

This method can execute multiple classes at the same time, and ensures that all third-party jar packages can be found. Also, if you modify one of the classes locally, you just need to re-upload the. class file for the modified class, and it's convenient.
Do not know if there is a wrong place, please correct me.

The things that the jar packages upload to the server side

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.