Name: yg153347 Date: 09/08/2004
Specification excerpt:
======================
JDK 5.0 RC documentation for javac at
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html
states the following
---------- begin-of-excerpt -------------
-source release
Specifies the version of source code accepted. The following values for release are allowed:
1.3 the compiler does not support assertions, generics, or other language features introduced
after JDK 1.3.
1.4 the compiler accepts code containing assertions, which were introduced in JDK 1.4.
1.5 the compiler accepts code containing generics and other language features introduced
in JDK 5. The compiler defaults to version 5 behavior if the -source flag is not used.
5 Synonym for 1.5
---------- end-of-excerpt ---------------
Problem description
===================
Documentation for javac in JDK 5.0 RC states that the minimal value for -source flag is 1.3.
Actually, -source 1.2 also can be used. Hence, the current javac behavior contradicts with
documentation.
Here is a small example:
-- Test.java --
public class Test {
public static void main(String[] args) {
System.out.println("Hello!");
}
}
-- Test.java --
<gyi@mars> javac -source 1.2 Test.java
<gyi@mars> java Test
Hello!
<gyi@mars> java -version
java version "1.5.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-rc-b63)
Java HotSpot(TM) Client VM (build 1.5.0-rc-b63, mixed mode)
======================================================================