FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
The javac technote here: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#crosscomp-example
says that specifying " -source 1.6 " will produce javase6 compatible class files and specifying " -target 1.6 " is not required.
But in practice this is not the case and omitting " -target 1.6 " will produce javase7 class files.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create ubiquitous HelloWorld.java
2. Compile with: javac -source 1.6 HelloWorld.java
3. Run with: /path/to/jre6/bin/java HelloWorld
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Prints " Hello, World! "
ACTUAL -
Exception about wrong class file vertion number.
REPRODUCIBILITY :
This bug can be reproduced always.
A DESCRIPTION OF THE PROBLEM :
The javac technote here: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#crosscomp-example
says that specifying " -source 1.6 " will produce javase6 compatible class files and specifying " -target 1.6 " is not required.
But in practice this is not the case and omitting " -target 1.6 " will produce javase7 class files.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create ubiquitous HelloWorld.java
2. Compile with: javac -source 1.6 HelloWorld.java
3. Run with: /path/to/jre6/bin/java HelloWorld
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Prints " Hello, World! "
ACTUAL -
Exception about wrong class file vertion number.
REPRODUCIBILITY :
This bug can be reproduced always.
- relates to
-
JDK-8058977 Add table that lists what version of class file is generated when the javac option -target is not specified.
- Closed