United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4996990 javac flag "target" is not compatible with previous release
JDK-4996990 : javac flag "target" is not compatible with previous release

Details
Type:
Bug
Submit Date:
2004-02-19
Status:
Closed
Updated Date:
2004-02-24
Project Name:
JDK
Resolved Date:
2004-02-24
Component:
tools
OS:
solaris_10
Sub-Component:
javac
CPU:
sparc
Priority:
P3
Resolution:
Not an Issue
Affected Versions:
5.0
Fixed Versions:

Related Reports

Sub Tasks

Description
Point JAVA_HOME to 1.5 latest build, and execute the following commands:

$JAVA_HOME/bin/javac -d . tstc.java
$JAVA_HOME/bin/javac -d . tsts.java
"$JAVA" $JAVA_FLAGS -Xfuture test.tstc
   rm -rf test/*.class
$JAVA_HOME/bin/javac -target 1.2 -d . tstc.java
$JAVA_HOME/bin/javac -target 1.2 -d . tsts.java
"$JAVA" $JAVA_FLAGS -Xfuture test.tstc

The the following exception shown:
javac: source release 1.4 requires target release 1.4
javac: source release 1.4 requires target release 1.4
Exception in thread "main" java.lang.NoClassDefFoundError: test/tstc

With previous version of jdk, this test passes. 

                                    

Comments
EVALUATION

We change the default -source and -target flags for javac between releases.
If you depend on the default, you will see a difference.  If you want
backward-compatible behavior, then you must specify both.

###@###.### 2004-02-23
                                     
2004-02-23
PUBLIC COMMENTS

...
                                     
2004-06-10



Hardware and Software, Engineered to Work Together