Java CP command

Source: Internet
Author: User

I usually use eclipse to execute Java programs. Today I want to open two interfaces under DOS to check the message interaction of the program. I don't even need to use them anymore and enter the directory where the class file is located,

When Java socketserver1 is executed, class not found error is always reported. The last question is that Java-CP and other parameters need to be added. Thank you !!

-The CP parameter is followed by a Class path, which specifies to the interpreter where to find your. Class file,
Statement:
Java-CP.; myclass. Jar packname. mainclassname
The jar file in classpath can use wildcards. If multiple jar files are used, they must be listed one by one. In a sense, the JAR file is the path.

You must specify the storage path for each jar file. The same path has multiple wildcards.
Java-CP.; C: \ Classes \ myclass. jar; D: \ Classes \ *. Jar packname. mainclassname

For example, the calss file is in the Directory D: \ workspace \ test \ SRC \ sockettest, and the class file is in the package sockettest.

Enter this directory

D: \ workspace \ test \ SRC \ sockettest> JAVA-CP ../sockettest. socketserver1

If you enter the parent directory, that is, D: \ workspace \ test \ SRC

Use D: \ workspace \ test \ SRC> JAVA-CP. sockettest. socketserver1

Command Execution

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.