When compiling Android4.4 with Openjdk, the following error occurs: & quot; error: unmappable character for encoding ASCII & quot;. openjdkandroid4.4

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.