Openjdkandroid4.4
Add environment variables:
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
You can ~ /. Add it to the bashrc file, so you don't have to manually change it every time!
Of course, after the preceding environment variable settings are added, the following prompt appears when you compile the environment variable:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
In this way, you do not need to switch jdk to the oracle version to compile Android4.4. You can use Openjdk7 to compile Android5.0 and Android4.4!
Error: unmappable ch
Yes, it's not compatible. The encoding settings are incorrect. You did it during compilation. ant has the encoding settings, even in ant. there are related configurations in xml files.
Linux: java file compilation error of checkout on svn
You can use javac-encoding gbk test2.java to output normally, indicating that your java file is encoded as utf8
An error occurred while compiling with javac test2.java, indicating that your system's default encoding is not utf8
There are two methods:
1) modify the system code to utf8
Echo $ LANG: What is your system code with this command?
Set $ LANG = "en_US.UTF-8" or zh_CN.UTF-8 (see if your system language is Chinese or English)
2) modify the file encoding
Open the test2.java file in notepad and save the file as --> select the encoding ANSI to save
Then javac test2.java can be compiled.