Home > Java > JavaBase > body text

Java error not found symbol solution (referencing custom class)

Release: 2019-12-10 17:09:23
Original
12557 people have browsed it

Java error not found symbol solution (referencing custom class)

Normally, when we write java files, we will reference some self-defined classes. If we compile according to the usual javac *.java format, it will not be found. Symbol error. (Recommended: java video tutorial)

The following two methods are provided for reference

If there are a.java and b under d:/web/wsh .java two files, a.java is referenced in the b.java file. The following is the compilation method

Method 1:
Enter d:/web/wsh: javac a.java
Then exit the wsh directory and enter javac wsh/b.java under d:/wsh The compilation is successful!

Method 2: Enter d:/web/wsh by using javac -classpath(cp) parameter
: javac a.java
Still in d:/wsh/wsh Next: javac -classpath d:/web/wsh b.java
This can also compile successfully!

For more java knowledge, please pay attention to the java basic tutorial column.

The above is the detailed content of Java error not found symbol solution (referencing custom class). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!