United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7010849 Extraneous javac source/target options when building sa-jdi
JDK-7010849 : Extraneous javac source/target options when building sa-jdi

Details
Type:
Bug
Submit Date:
2011-01-07
Status:
Closed
Updated Date:
2011-07-29
Project Name:
JDK
Resolved Date:
2011-04-24
Component:
hotspot
OS:
generic
Sub-Component:
svc
CPU:
generic
Priority:
P5
Resolution:
Fixed
Affected Versions:
hs20
Fixed Versions:
hs21 (b09)

Related Reports
Backport:

Sub Tasks

Description
I noticed the following in a JPRT build log:

echo "Making ../generated/sa-jdi.jar";
Making ../generated/sa-jdi.jar
if [ "/opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20" = "" ]; then \
   echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
   exit 1; \
fi
if [ ! -f /opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20/lib/tools.jar -a ! -d /opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20/lib/modules ] ; then \
  echo "Missing /opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20/lib/tools.jar file. Use 1.6.0 or later version of JDK";\
  echo ""; \
  exit 1; \
fi
if [ ! -d ../generated/saclasses ] ; then \
  mkdir -p ../generated/saclasses;        \
fi
/opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20/bin/javac -g -encoding ascii -source 6 -target 6 -source 1.4 -target 1.4 -classpath /opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20/lib/tools.jar -sourcepath /opt/jprt/temp/P1/B/020358.dh198349/source/agent/src/share/classes -d ../generated/saclasses @../generated/agent1.classes.list
/opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20/bin/javac -g -encoding ascii -source 6 -target 6 -source 1.4 -target 1.4 -classpath /opt/jprt/products/P1/jdk6u20-fcs/jdk1.6.0_20/lib/tools.jar -sourcepath /opt/jprt/temp/P1/B/020358.dh198349/source/agent/src/share/classes -d ../generated/saclasses @../generated/agent2.classes.list

Note the javac invocation defines:

source 6 -target 6 -source 1.4 -target 1.4 

I believe the SA is still supposed to be built as 1.4 (and I expect that the last option takes precedent here).
The SA is built with '-source 1.4' because it uses "enum" as
an identifier. This bug could be used as the vehicle for
solving that issue (and any others that require the use of
'-source 1.4'.

                                    

Comments
EVALUATION

Dr Andrew John Hughes provided the patch to the SA code that
allows us to drop the "-source 1.4 -target 1.4" options.

Thanks Andrew!
                                     
2011-04-01
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/37be97a58393
                                     
2011-04-02



Hardware and Software, Engineered to Work Together