JDK-7010849 : Extraneous javac source/target options when building sa-jdi
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: hs20
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-01-07
  • Updated: 2011-07-29
  • Resolved: 2011-04-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 Other
7Fixed hs21Fixed
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; \
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; \
if [ ! -d ../generated/saclasses ] ; then \
  mkdir -p ../generated/saclasses;        \
/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'.

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/37be97a58393

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!