java cannot be compiled
There are many reasons why java cannot be compiled. Here are the common reasons and solutions.
1. javac is not an internal or external command, nor is it an operable program.
The above prompt appears because our java environment variables are not configured properly. The solution is to add jdk directory\bin to the computer system variable Path, and then reopen cmd.
2. Error: Encoding GBK unmappable characters
Such an error occurs because of inconsistent encoding. The solution is to use the editor to Convert the file encoding to ANSI encoding, use javac -encoding GBK fliename.java to specify the encoding format when compiling, or convert the file to utf-8 format, and specify the encoding to utf-8 when compiling .
php Chinese website, a large number of free Java introductory tutorials, welcome to learn online!
The above is the detailed content of java cannot compile. For more information, please follow other related articles on the PHP Chinese website!