Java CP command

Source: Internet
Author: User

JAVA-CP.; C:\dir1\lib.jar Test

-CP, like-classpath, is the path to the other classes that the specified class runs on, usually the class library, the jar package, and so on, which requires a full path to the jar package, and a semicolon on the window.

Delimited, a semicolon ":" is separated on Linux. Wildcard characters are not supported and all jar packages need to be listed with a little "." Represents the current path.
Although there is now an IDE like Eclipse, but sometimes it will be manually compiled and run some programs, many people, including many years of development experience, do not know how to command line parameters
Number of run classes. A little cup of ...
Examples of Use:
JAVA-CP. \lib\hsqldb.jar Org.hsqldb.server-database MyDB
Or
JAVA-CP. /lib/hsqldb.jar org.hsqldb.server-database.0 mydb-dbname.0 MyDB

Java code java-jar   minusyhd.jar  manifest-version:1.0  main-class:minusyhd. MINUSYHD  Class-path:jconn4.jar  

Writing:
JAVA-CP.; Myclass.jar Packname.mainclassname
The jar file in the classpath can use wildcards, and if it is multiple jar files, it should be listed one by one, and in a sense the jar file is the path.

To specify a specific storage path for each jar file, multiple wildcard characters can be used for the same path
JAVA-CP.; C:\classes\myclass.jar;d:\classes\*.jar Packname.mainclassname


BAT file notation:

JAVA-CP Minusyhd.jar Minusyhd. Minusyhd > Minusyhed.log  exit

"> minusyhed.log" specifies system.out output file name

Java CP command

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.