error
Today in cmd tests java code when I encountered an error
Solution:
Enter javac -encoding utf-8 filename .java
the reason:
Since the JDK is the international version, when we use javac compiler, the compiler will first obtain our operating system default encoding format (GBK) used, and then put the Java JDK source files from GBK encoding formats into internal default Java Unicode format placed in memory, then the converted file javac Unicode format class files compiled into class, this time, the class file is a Unicode encoding, temporarily stores it in memory, subsequently, the JDK encoded in Unicode format this class files save to the operating system we see the formation of class file. When we set it without compile-time, equivalent to using parameters: javac -encoding GBK BRRead.java, incompatibilities will arise.