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