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