Current location - Quotes Website - Signature design - What should I do if Java cannot find the symbol?
What should I do if Java cannot find the symbol?

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 specifies the location to search for user class files;

7) -cp specifies the search The location of the user class file;?

8) -sourcepath specifies the location to find the input source file;?

9) -bootclasspath overrides the location of the boot class file ;?

10) -extdirs Overwrites the location of the installed extension directory;

11) -endorseddirs Overrides the location of the signed standard path;?

12) -d specifies the location where the generated class files are stored;?

13) -encoding specifies the character encoding used in the source file;

14) -source provides source compatibility with the specified version;?

15) -target generates class files for a specific VM version;?

16)- version version information;

17) -help outputs a summary of standard options;

18) -X outputs a summary of non-standard options;

19) -J Pass directly to the runtime system.