...../.../MyFile.java:8: error: unmappable character for encoding ASCII
* ?? Copyright XX All Rights Reserved
^
Note that "file MyFile.java" showed UTF8, and this was indeed its encoding. Turns out Java was deciding or guessing it was ASCII, incorrectly.
One solution was to force the encoding, like this:
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8And even better, since I use Gradle, was to use compileJava.options.encoding. In my top-level gradle file:
subprojects {
apply plugin: 'java' compileJava.options.encoding = 'UTF-8'
...
I hope this helps someone else!