The help of javac, java, and javap is used to compile and execute programs composed of several files.
I encountered several problems:
1. Call between classes in the package
The directory structure is com/test/*. java.
[Java]
// A. java
Package com. test;
Public class {
New B ();
}
// B. java
Package com. test;
Class B {
}
In the test folder, use javac to compile B. after java, compile. in java, B cannot be found. In javap, the Class Name of B is com. test. b.
Therefore, during compilation, You need to compile in the top-level directory of com to complete the compilation of classes in the package.
2. When the main function class is running, the following command fails:
[Java]
Java com \ test \ ClassName // the current directory is the top-level directory of com
Check the command method in Eclipse and find that the running mode is
[Java]
Java com. test. ClassName