Most of the Java Card source files contain a copyright line with the © character, which results in a compilation warning when using javac from JDK 1.5. These used to compile without warning using javac from JDK 1.4.x.
The javac (ver. 1.5) warning message is: "unmappable character for encoding ASCII"
Our only option is to use the javac -nowarn option, but that is unacceptable.
Sun legal requires us to use the © character instead of (c).
If you believe this is not the case, please send us a statement from Sun legal.
But, consider that customers may also want to insert copyright statments which include the © character.
==================== file copyright.java
// Copyright © 2003 Sun Microsystems, Inc.
public class copyright {
public static void main(String[] args){
System.out.println("done");
}
}
1) set JAVA_HOME to JDK1.4.x and compile:
jcdi-qa-1 (26) % $JAVA_HOME/bin/java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
jcdi-qa-1 (27) % $JAVA_HOME/bin/javac copyright.java
(there is no compilation warning).
2) set JAVA_HOME to JDK1.5.0 and compile:
jcdi-qa-1 (29) % $JAVA_HOME/bin/java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Server VM (build 1.5.0_01-b08, mixed mode)
jcdi-qa-1 (30) % $JAVA_HOME/bin/javac copyright.java
copyright.java:1: warning: unmappable character for encoding ASCII
// Copyright ? 2003 Sun Microsystems, Inc.
^
1 warning
===============================================================================
The javac (ver. 1.5) warning message is: "unmappable character for encoding ASCII"
Our only option is to use the javac -nowarn option, but that is unacceptable.
Sun legal requires us to use the © character instead of (c).
If you believe this is not the case, please send us a statement from Sun legal.
But, consider that customers may also want to insert copyright statments which include the © character.
==================== file copyright.java
// Copyright © 2003 Sun Microsystems, Inc.
public class copyright {
public static void main(String[] args){
System.out.println("done");
}
}
1) set JAVA_HOME to JDK1.4.x and compile:
jcdi-qa-1 (26) % $JAVA_HOME/bin/java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
jcdi-qa-1 (27) % $JAVA_HOME/bin/javac copyright.java
(there is no compilation warning).
2) set JAVA_HOME to JDK1.5.0 and compile:
jcdi-qa-1 (29) % $JAVA_HOME/bin/java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Server VM (build 1.5.0_01-b08, mixed mode)
jcdi-qa-1 (30) % $JAVA_HOME/bin/javac copyright.java
copyright.java:1: warning: unmappable character for encoding ASCII
// Copyright ? 2003 Sun Microsystems, Inc.
^
1 warning
===============================================================================
- duplicates
-
JDK-5048557 javac fails to compile code with encoding errors.
- Resolved