Method 1:
1. Enter d:/web/wsh: javac a.java;
2. Then exit the wsh directory and enter d: /wsh javac wsh/b.java can be compiled successfully!
Method 2:
1. By using the javac -classpath (cp) parameter;
2. Enter d:/web/wsh: javac a. java;
3. Still under d:/wsh/wsh: javac -classpath d:/web/wsh b.java;
This can also be compiled successfully!
The following methods have all passed the test!
The following are the parameters for javac compilation:
1. Usage: javac
2. Options:?
1) -g:none does not generate any debugging information;
2) -g:{lines,vars,source} only generates some debugging information ;
3) -nowarn does not generate any warnings;
4) -verbose outputs messages about what the compiler is doing;?
5)- deprecation outputs the source location using the deprecated API;?
6) -classpath
7) -cp
8) -sourcepath
9) -bootclasspath
10) -extdirs
11) -endorseddirs
12) -d
13) -encoding
14) -source
15) -target
16)- version version information;
17) -help outputs a summary of standard options;
18) -X outputs a summary of non-standard options;
19) -J