Java command number compilation runtime add third-party libraries

Source: Internet
Author: User

While it is now easy to add a third-party external library in a variety of integrated development environments, it is necessary for beginners to master command-line Javac to compile Java operations. Learning Classpath The use of options allows you to manually add a third-party external library without using the integrated development environment.

Tool Preparation:

Text editor Coda2, as a demo of the MySQL driver package Mysql-connector-java-5.1.36-bin.jar.

Command Description:

How to use Classpath:

Command form:

Javac-classpath Some0.jar:some1.jar:...:somen.jar:. Yourjava.java (the next colon of Windows is changed;)

Java-classpath Some0.jar:some1.jar:...:somen.jar:. YourClass (the next colon of Windows is changed;)

-classpath

The option can be used to override the directory specified by the CLASSPATH environment variable (default is the current directory if not specified), so add the current directory after adding the new external library directory.

Java command number compilation runtime add third-party libraries

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.