"unmappable character for encoding" warning in Java "unmappable character for encoding" warning in Java java java

"unmappable character for encoding" warning in Java


Try with:javac -encoding ISO-8859-1 file_name.java


Use the "\uxxxx" escape format.

According to Wikipedia, the copyright symbol is unicode U+00A9 so your line should read:

String copyright = "\u00a9 2003-2008 My Company. All rights reserved.";


If you're using Maven, set the <encoding> explicitly in the compiler plugin's configuration, e.g.

<build>    <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-compiler-plugin</artifactId>            <version>2.3.2</version>            <configuration>                <encoding>UTF-8</encoding>            </configuration>        </plugin>