changeset 27572:f2dcd0af93b2

Merge
author duke
date Wed, 05 Jul 2017 20:08:27 +0200
parents 08ef93eaca80 e1e604459d71
children f20b507032b5
files corba/make/CommonCorba.gmk corba/make/CompileCorba.gmk corba/make/GensrcCorba.gmk jdk/make/Bundles.gmk jdk/make/CreateJars.gmk jdk/make/CreatePolicyJars.gmk jdk/make/CreateSecurityJars.gmk jdk/make/Images.gmk jdk/make/ProfileNames.gmk jdk/make/Profiles.gmk jdk/make/profile-includes.txt jdk/make/profile-rtjar-includes.txt jdk/src/jdk.dev/share/classes/com/sun/tools/script/shell/Main.java jdk/src/jdk.dev/share/classes/com/sun/tools/script/shell/init.js jdk/src/jdk.dev/share/classes/com/sun/tools/script/shell/messages.properties jdk/src/jdk.localedata/META-INF/cldrdata-services/sun.util.locale.provider.LocaleDataMetaInfo jdk/src/jdk.localedata/META-INF/localedata-services/sun.util.locale.provider.LocaleDataMetaInfo jdk/test/javax/crypto/sanity/CheckManifestForRelease.java jdk/test/lib/security/java.policy/Ext_AllPolicy.java jdk/test/lib/security/java.policy/Ext_AllPolicy.sh jdk/test/lib/security/java.policy/test.policy jdk/test/sun/tools/jconsole/ResourceCheckTest.sh jdk/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh
diffstat 330 files changed, 16364 insertions(+), 8292 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags-top-repo	Wed Dec 03 14:26:07 2014 +0000
+++ b/.hgtags-top-repo	Wed Jul 05 20:08:27 2017 +0200
@@ -282,3 +282,4 @@
 723a67b0c442391447b1d8aad8b249d06d1032e8 jdk9-b37
 d42c0a90afc3c66ca87543076ec9aafd4b4680de jdk9-b38
 512dbbeb1730edcebfec873fc3f1455660b32000 jdk9-b39
+cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40
--- a/Makefile	Wed Dec 03 14:26:07 2014 +0000
+++ b/Makefile	Wed Jul 05 20:08:27 2017 +0200
@@ -143,31 +143,37 @@
 	$(info .  make [default]         # Compile all modules in langtools, hotspot, jaxp, jaxws,)
 	$(info .                         # corba and jdk and create a runnable "exploded" image)
 	$(info .  make all               # Compile everything, all repos, docs and images)
-	$(info .  make images            # Create complete j2sdk and j2re images)
+	$(info .  make images            # Create complete jdk and jre images)
+	$(info .  make <phase>           # Compile the specified phase and everything it depends on)
+	$(info .                         # (gensrc, java, copy, libs, launchers, gendata, rmic))
+	$(info .  make *-only            # Applies to most targets and disables compling the)
+	$(info .                         # dependencies for the target. This is faster but may)
+	$(info .                         # result in incorrect build results!)
 	$(info .  make docs              # Create all docs)
 	$(info .  make docs-javadoc      # Create just javadocs, depends on less than full docs)
-	$(info .  make profiles          # Create complete j2re compact profile images)
+	$(info .  make profiles          # Create complete jre compact profile images)
 	$(info .  make bootcycle-images  # Build images twice, second time with newly built JDK)
 	$(info .  make install           # Install the generated images locally)
 	$(info .  make reconfigure       # Rerun configure with the same arguments as last time)
+	$(info .  make help              # Give some help on using make)
+	$(info .  make test              # Run tests, default is all tests (see TEST below))
+	$(info )
+	$(info Targets for cleaning)
 	$(info .  make clean             # Remove all files generated by make, but not those)
 	$(info .                         # generated by configure)
 	$(info .  make dist-clean        # Remove all files, including configuration)
-	$(info .  make help              # Give some help on using make)
-	$(info .  make test              # Run tests, default is all tests (see TEST below))
+	$(info .  make clean-<outputdir> # Remove the subdir in the output dir with the name)
+	$(info .  make clean-<phase>     # Remove all build results related to a certain build)
+	$(info .                         # phase (gensrc, java, libs, launchers))
+	$(info .  make clean-<module>    # Remove all build results related to a certain module)
+	$(info .  make clean-<module>-<phase> # Remove all build results related to a certain)
+	$(info .                         # module and phase)
 	$(info )
 	$(info Targets for specific modules)
 	$(info .  make <module>          # Build <module> and everything it depends on. )
-	$(info .  make <module>-only     # Build <module> only, without dependencies. This)
-	$(info .                         # is faster but can result in incorrect build results!)
-	$(info .  make <module>-java     # Compile java classes for <module> and everything it)
-	$(info .                         # depends on)
-	$(info .  make <module>-libs     # Build native libraries for <module> and everything it)
-	$(info .                         # depends on)
-	$(info .  make <module>-launchers# Build native executables for <module> and everything it)
-	$(info .                         # depends on)
-	$(info .  make <module>-gensrc   # Execute the gensrc step for <module> and everything it)
-	$(info .                         # depends on)
+	$(info .  make <module>-<phase>  # Compile the specified phase for the specified module)
+	$(info .                         # and everything it depends on)
+	$(info .                         # (gensrc, java, copy, libs, launchers, gendata, rmic))
 	$(info )
 	$(info Useful make variables)
 	$(info .  make CONF=             # Build all configurations (note, assignment is empty))
--- a/common/autoconf/boot-jdk.m4	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/autoconf/boot-jdk.m4	Wed Jul 05 20:08:27 2017 +0200
@@ -305,20 +305,6 @@
     AC_MSG_ERROR([Cannot continue])
   fi
 
-  # Setup proper paths for what we found
-  BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
-  if test ! -f "$BOOT_RTJAR"; then
-    # On MacOSX it is called classes.jar
-    BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
-    if test -f "$BOOT_RTJAR"; then
-      # Remove the ..
-      BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
-    fi
-  fi
-  BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
-  BOOT_JDK="$BOOT_JDK"
-  AC_SUBST(BOOT_RTJAR)
-  AC_SUBST(BOOT_TOOLSJAR)
   AC_SUBST(BOOT_JDK)
 
   # Setup tools from the Boot JDK.
--- a/common/autoconf/bootcycle-spec.gmk.in	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/autoconf/bootcycle-spec.gmk.in	Wed Jul 05 20:08:27 2017 +0200
@@ -42,13 +42,12 @@
 
 # Override specific values to do a boot cycle build
 
+# Use a different Boot JDK
+BOOT_JDK := $(JDK_IMAGE_DIR)
+
 # The bootcycle build has a different output directory
 BUILD_OUTPUT:=@BUILD_OUTPUT@/bootcycle-build
-
-# Use a different Boot JDK
-OLD_BOOT_JDK:=$(BOOT_JDK)
-BOOT_JDK:=@BUILD_OUTPUT@/images/j2sdk-image
-BOOT_RTJAR:=$(BOOT_JDK)/jre/lib/rt.jar
+SJAVAC_SERVER_DIR:=$(subst @BUILD_OUTPUT@,$(BUILD_OUTPUT),$(SJAVAC_SERVER_DIR))
 
 JAVA_CMD:=$(BOOT_JDK)/bin/java
 JAVAC_CMD:=$(BOOT_JDK)/bin/javac
--- a/common/autoconf/compare.sh.in	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/autoconf/compare.sh.in	Wed Jul 05 20:08:27 2017 +0200
@@ -46,6 +46,7 @@
 FIND="@FIND@"
 GREP="@GREP@"
 JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
+JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage"
 LDD="@LDD@"
 MKDIR="@MKDIR@"
 NAWK="@NAWK@"
--- a/common/autoconf/flags.m4	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/autoconf/flags.m4	Wed Jul 05 20:08:27 2017 +0200
@@ -784,24 +784,24 @@
   LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
     LDFLAGS_JDKLIB_SUFFIX=""
   else
     LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB}  ${SHARED_LIBRARY_FLAGS} \
-        -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
+        -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
 
     # On some platforms (mac) the linker warns about non existing -L dirs.
     # Add server first if available. Linking aginst client does not always produce the same results.
     # Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
     # Default to server for other variants.
     if test "x$JVM_VARIANT_SERVER" = xtrue; then
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
     elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/client"
     elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
     else
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
     fi
 
     LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
--- a/common/autoconf/generated-configure.sh	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 20:08:27 2017 +0200
@@ -820,8 +820,6 @@
 JAVAC
 JAVA
 BOOT_JDK
-BOOT_TOOLSJAR
-BOOT_RTJAR
 JAVA_CHECK
 JAVAC_CHECK
 COOKED_BUILD_NUMBER
@@ -4328,7 +4326,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1415179461
+DATE_WHEN_GENERATED=1416999037
 
 ###############################################################################
 #
@@ -25533,20 +25531,6 @@
     as_fn_error $? "Cannot continue" "$LINENO" 5
   fi
 
-  # Setup proper paths for what we found
-  BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
-  if test ! -f "$BOOT_RTJAR"; then
-    # On MacOSX it is called classes.jar
-    BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
-    if test -f "$BOOT_RTJAR"; then
-      # Remove the ..
-      BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
-    fi
-  fi
-  BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
-  BOOT_JDK="$BOOT_JDK"
-
-
 
 
   # Setup tools from the Boot JDK.
@@ -42870,24 +42854,24 @@
   LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
     LDFLAGS_JDKLIB_SUFFIX=""
   else
     LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB}  ${SHARED_LIBRARY_FLAGS} \
-        -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
+        -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
 
     # On some platforms (mac) the linker warns about non existing -L dirs.
     # Add server first if available. Linking aginst client does not always produce the same results.
     # Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
     # Default to server for other variants.
     if test "x$JVM_VARIANT_SERVER" = xtrue; then
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
     elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/client"
     elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
-    else
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
+    else
+      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
     fi
 
     LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
--- a/common/autoconf/spec.gmk.in	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 20:08:27 2017 +0200
@@ -236,31 +236,23 @@
 
 BUILD_OUTPUT:=@BUILD_OUTPUT@
 # Colon left out to be able to override IMAGES_OUTPUTDIR for bootcycle-images
-LANGTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/langtools
-CORBA_OUTPUTDIR=$(BUILD_OUTPUT)/corba
-JAXP_OUTPUTDIR=$(BUILD_OUTPUT)/jaxp
-JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
+SUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/support
+BUILDTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/buildtools
+MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/makesupport
+
 HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
 JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
-NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
 IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
 TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/testmake
 MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
 
-LANGTOOLS_DIST=$(LANGTOOLS_OUTPUTDIR)/dist
-CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
-JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
-JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
 HOTSPOT_DIST=@HOTSPOT_DIST@
-NASHORN_DIST=$(NASHORN_OUTPUTDIR)/dist
 
 BUILD_HOTSPOT=@BUILD_HOTSPOT@
 
-# The boot jdk to use. These are overridden in bootcycle-spec.gmk. Make sure to keep
-# them in sync.
+# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
+# it in sync.
 BOOT_JDK:=@BOOT_JDK@
-BOOT_RTJAR:=@BOOT_RTJAR@
-BOOT_TOOLSJAR=$(BOOT_JDK)/lib/tools.jar
 
 # When compiling Java source to be run by the boot jdk
 # use these extra flags, eg -source 6 -target 6
@@ -484,13 +476,14 @@
 JAVAC_FLAGS?=@JAVAC_FLAGS@
 
 # You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
-INTERIM_LANGTOOLS_JAR := $(LANGTOOLS_OUTPUTDIR)/dist/interim_langtools.jar
-INTERIM_LANGTOOLS_ARGS := "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
+# Use = assignment to be able to override in bootcycle-spec.gmk
+INTERIM_LANGTOOLS_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_langtools.jar
+INTERIM_LANGTOOLS_ARGS = "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
 NEW_JAVAC   = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javac.Main
 NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javadoc.Main
 
 # The interim corba jar is needed for running rmic
-INTERIM_CORBA_JAR := $(CORBA_OUTPUTDIR)/dist/interim_corba.jar
+INTERIM_CORBA_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_corba.jar
 
 # Base flags for RC
 # Guarding this against resetting value. Legacy make files include spec multiple
@@ -695,19 +688,15 @@
 OS_VERSION_MICRO:=@OS_VERSION_MICRO@
 
 # Images directory definitions
-JDK_IMAGE_SUBDIR:=j2sdk-image
-JRE_IMAGE_SUBDIR:=j2re-image
-JDK_OVERLAY_IMAGE_SUBDIR:=j2sdk-overlay-image
-JRE_OVERLAY_IMAGE_SUBDIR:=j2re-overlay-image
+JDK_IMAGE_SUBDIR:=jdk
+JRE_IMAGE_SUBDIR:=jre
 # Colon left out to be able to override output dir for bootcycle-images
 JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
 JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
-JDK_OVERLAY_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_OVERLAY_IMAGE_SUBDIR)
-JRE_OVERLAY_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_OVERLAY_IMAGE_SUBDIR)
 
 # Macosx bundles directory definitions
-JDK_BUNDLE_SUBDIR=j2sdk-bundle/jdk$(JDK_VERSION).jdk/Contents
-JRE_BUNDLE_SUBDIR=j2re-bundle/jre$(JDK_VERSION).jre/Contents
+JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
+JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
 JDK_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_BUNDLE_SUBDIR)
 JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR)
 
--- a/common/bin/compare.sh	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/bin/compare.sh	Wed Jul 05 20:08:27 2017 +0200
@@ -103,8 +103,8 @@
 	        -e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \
 	        -e thePoint -e aPoint -e setItemsPtr \
                 -e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then
-            $JAVAP -c -constants -l -p ${OTHER_FILE} >  ${OTHER_FILE}.javap
-            $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
+            $JAVAP -c -constants -l -p "${OTHER_FILE}" >  ${OTHER_FILE}.javap
+            $JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap
             TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
                 $GREP '^[<>]' | \
                 $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
@@ -298,7 +298,7 @@
     WORK_DIR=$3
     
     GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
-        ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
+        ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" ! -name "*.jimage" \
         ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
         ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
         ! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \
@@ -395,8 +395,14 @@
     $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
     $MKDIR -p $THIS_UNZIPDIR
     $MKDIR -p $OTHER_UNZIPDIR
-    (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
-    (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
+    if [ "$TYPE" = "jimage" ]
+    then
+        (cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
+        (cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
+    else
+        (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
+        (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
+    fi
 
     # Find all archives inside and unzip them as well to compare the contents rather than
     # the archives. pie.jar.pack.gz i app3.war is corrupt, skip it.
@@ -525,7 +531,7 @@
 
     # TODO filter?
     ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \
-        | $SORT | $FILTER)
+        -o -name "*.jimage" | $SORT | $FILTER)
 
     if [ -n "$ZIPS" ]; then
         echo Jar files...
@@ -633,7 +639,7 @@
         if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
         # The files were bytewise identical.
             if [ -n "$VERBOSE" ]; then
-                echo "        :           :         :         :          : $BIN_FILE"
+                echo "        :           :         :         :          :          : $BIN_FILE"
             fi
             return 0
         fi
@@ -1136,17 +1142,8 @@
 
 if [ "$SKIP_DEFAULT" != "true" ]; then
     if [ -z "$OTHER" ]; then
-        OTHER="$THIS/../$LEGACY_BUILD_DIR"
-        if [ -d "$OTHER" ]; then
-            OTHER="$( cd "$OTHER" && pwd )"
-        else
-            echo "Default old build directory does not exist:"
-            echo "$OTHER"
-            exit 1
-        fi
-        echo "Comparing to default old build:"
-        echo "$OTHER"
-        echo
+        echo "Nothing to compare to, set with -o"
+        exit 1
     else
         if [ ! -d "$OTHER" ]; then
             echo "Other build directory does not exist:"
@@ -1160,90 +1157,36 @@
     fi
 
 
-    # Figure out the layout of the this build. Which kinds of images have been produced
-    if [ -d "$THIS/install/j2sdk-image" ]; then
-        THIS_J2SDK="$THIS/install/j2sdk-image"
-        THIS_J2RE="$THIS/install/j2re-image"
-        echo "Selecting install images in this build"
-    elif [ -d "$THIS/deploy/j2sdk-image" ]; then
-        THIS_J2SDK="$THIS/deploy/j2sdk-image"
-        THIS_J2RE="$THIS/deploy/j2re-image"
-        echo "Selecting deploy images in this build"
-    elif [ -d "$THIS/images/j2sdk-image" ]; then
-        THIS_J2SDK="$THIS/images/j2sdk-image"
-        THIS_J2RE="$THIS/images/j2re-image"
-        echo "Selecting jdk images in this build"
+    # Find the common images to compare, prioritizing later build stages
+    if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then
+        THIS_J2SDK="$THIS/install/jdk"
+        THIS_J2RE="$THIS/install/jre"
+        OTHER_J2SDK="$OTHER/install/jdk"
+        OTHER_J2RE="$OTHER/install/jre"
+        echo "Selecting install images for compare"
+    elif [ -d "$THIS/deploy/jdk" ] && [ -d "$OTHER/deploy/jdk" ]; then
+        THIS_J2SDK="$THIS/deploy/jdk"
+        THIS_J2RE="$THIS/deploy/jre"
+        OTHER_J2SDK="$OTHER/deploy/jdk"
+        OTHER_J2RE="$OTHER/deploy/jre"
+        echo "Selecting deploy images for compare"
+    elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
+        THIS_J2SDK="$THIS/images/jdk"
+        THIS_J2RE="$THIS/images/jre"
+        OTHER_J2SDK="$OTHER/images/jdk"
+        OTHER_J2RE="$OTHER/images/jre"
+        echo "Selecting jdk images for compare"
+    else
+	echo "No common images found."
+	exit 1
     fi
 
-    if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
-        if [ -d "$THIS/install/j2sdk-image" ]; then
-            # If there is an install image, prefer that, it's also overlay
-            THIS_J2SDK_OVERLAY="$THIS/install/j2sdk-image"
-            THIS_J2RE_OVERLAY="$THIS/install/j2re-image"
-            echo "Selecting install overlay images in this build"
-        else
-            THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
-            THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
-            echo "Selecting jdk overlay images in this build"
-        fi
-    fi
-
-    if [ -d "$THIS/images/j2sdk-bundle" ]; then
-        THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle"
-        THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle"
-        echo "Selecting bundles in this build"
-    fi
-
-    # Figure out the layout of the other build (old or new, normal or overlay image)
-    if [ -d "$OTHER/j2sdk-image" ]; then
-        if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then
-            OTHER_J2SDK="$OTHER/j2sdk-image"
-            OTHER_J2RE="$OTHER/j2re-image"
-            echo "Selecting old-style images in other build"
-        else
-            OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
-            OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
-            echo "Selecting overlay images in other build"
-        fi
-    elif [ -d "$OTHER/install/j2sdk-image" ]; then
-        OTHER_J2SDK="$OTHER/install/j2sdk-image"
-        OTHER_J2RE="$OTHER/install/j2re-image"
-        echo "Selecting install images in other build"
-    elif [ -d "$OTHER/deploy/j2sdk-image" ]; then
-        OTHER_J2SDK="$OTHER/deploy/j2sdk-image"
-        OTHER_J2RE="$OTHER/deploy/j2re-image"
-        echo "Selecting deploy images in other build"
-    elif [ -d "$OTHER/images/j2sdk-image" ]; then
-        OTHER_J2SDK="$OTHER/images/j2sdk-image"
-        OTHER_J2RE="$OTHER/images/j2re-image"
-        echo "Selecting jdk images in other build"
-    fi
-
-    if [ -d "$OTHER/j2sdk-bundle" ]; then
-        OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle"
-        OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle"
-        echo "Selecting bundles in other build"
-    elif [ -d "$OTHER/images/j2sdk-bundle" ]; then
-        OTHER_J2SDK_BUNDLE="$OTHER/images/j2sdk-bundle"
-        OTHER_J2RE_BUNDLE="$OTHER/images/j2re-bundle"
-        echo "Selecting jdk bundles in other build"
-    fi
-    
-    if [ -z "$THIS_J2SDK" ] || [ -z "$THIS_J2RE" ]; then
-        if [ -z "$THIS_J2SDK_OVERLAY" ]; then
-            echo "Cannot locate images for this build. Are you sure you have run 'make images'?"
-            exit 1
-        fi
-    fi
-
-    if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then
-        echo "OTHER build only has an overlay image while this build does not. Nothing to compare!"
-        exit 1
-    fi
-
-    if [ -z "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
-        echo "WARNING! OTHER build has bundles built while this build does not."
-        echo "Skipping bundle compare!"
+    if [ -d "$THIS/images/jdk-bundle" ] && [ -d "$OTHER/images/jdk-bundle" ]; then
+        THIS_J2SDK_BUNDLE="$THIS/images/jdk-bundle"
+        THIS_J2RE_BUNDLE="$THIS/images/jre-bundle"
+        OTHER_J2SDK_BUNDLE="$OTHER/images/jdk-bundle"
+        OTHER_J2RE_BUNDLE="$OTHER/images/jre-bundle"
+        echo "Also comparing macosx bundles"
     fi
 
     if [ -d "$OTHER/images" ]; then
@@ -1266,22 +1209,13 @@
         THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
     fi
 
-    if [ -d "$THIS/docs" ]; then
+    if [ -d "$THIS/docs" ] && [ -d "$OTHER/docs" ]; then
         THIS_DOCS="$THIS/docs"
-    fi
-
-    if [ -d "$OTHER/docs" ]; then
         OTHER_DOCS="$OTHER/docs"
-    fi
-
-    if [ -z "$THIS_DOCS" ]; then
+	echo "Also comparing docs"
+    else
         echo "WARNING! Docs haven't been built and won't be compared."
     fi
-
-    if [ -z "$OTHER_DOCS" ]; then
-        echo "WARNING! Other build doesn't contain docs, skipping doc compare."
-    fi
-
 fi
 
 ##########################################################################################
@@ -1299,27 +1233,16 @@
         echo -n "J2RE  "
         compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
     fi
-    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
-        echo -n "J2SDK Overlay "
-        compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
-        echo -n "J2RE  Overlay "
-        compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
-        
-        echo -n "J2SDK Overlay "
-        compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
-        echo -n "J2RE  Overlay "
-        compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
-    fi
     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
         echo -n "J2SDK Bundle "
-        compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+        compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
         echo -n "J2RE  Bundle "
-        compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+        compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
         
         echo -n "J2SDK Bundle "
-        compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+        compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
         echo -n "J2RE  Bundle "
-        compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+        compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
         echo -n "Docs "
@@ -1340,18 +1263,6 @@
         echo -n "J2RE  "
         compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
     fi
-    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
-        echo -n "J2SDK Overlay "
-        compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
-        echo -n "J2RE  Overlay "
-        compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
-    fi
-    if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
-        echo -n "J2SDK Bundle "
-        compare_permissions $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
-        echo -n "J2RE  Bundle "
-        compare_permissions $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
-    fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
     fi
@@ -1364,17 +1275,11 @@
         echo -n "J2RE  "
         compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
     fi
-    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
-        echo -n "J2SDK Overlay "
-        compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
-        echo -n "J2RE  Overlay "
-        compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
-    fi
     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
         echo -n "J2SDK Bundle "
-        compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+        compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
         echo -n "J2RE  Bundle "
-        compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+        compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
@@ -1388,17 +1293,11 @@
         echo -n "J2RE  "
         compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
     fi
-    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
-        echo -n "J2SDK Overlay "
-        compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
-        echo -n "J2RE  Overlay "
-        compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
-    fi
     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
         echo -n "J2SDK Bundle "
-        compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+        compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
         echo -n "J2RE  Bundle "
-        compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+        compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
         echo -n "Docs "
@@ -1454,10 +1353,6 @@
             compare_all_libs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
         fi
     fi
-    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
-        echo -n "Bundle   "
-        compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
-    fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
     fi
@@ -1467,10 +1362,6 @@
     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
         compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
     fi
-    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
-        echo -n "Overlay "
-        compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
-    fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
     fi
--- a/common/bin/compare_exceptions.sh.incl	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/bin/compare_exceptions.sh.incl	Wed Jul 05 20:08:27 2017 +0200
@@ -84,7 +84,9 @@
 ./bin/jconsole
 ./bin/jdb
 ./bin/jhat
+./bin/jimage
 ./bin/jinfo
+./bin/jjs
 ./bin/jmap
 ./bin/jps
 ./bin/jrunscript
@@ -171,7 +173,9 @@
 ./bin/jconsole
 ./bin/jdb
 ./bin/jhat
+./bin/jimage
 ./bin/jinfo
+./bin/jjs
 ./bin/jmap
 ./bin/jps
 ./bin/jrunscript
@@ -314,7 +318,9 @@
 ./bin/jconsole
 ./bin/jdb
 ./bin/jhat
+./bin/jimage
 ./bin/jinfo
+./bin/jjs
 ./bin/jmap
 ./bin/jps
 ./bin/jrunscript
@@ -453,7 +459,9 @@
 ./bin/amd64/jconsole
 ./bin/amd64/jdb
 ./bin/amd64/jhat
+./bin/amd64/jimage
 ./bin/amd64/jinfo
+./bin/amd64/jjs
 ./bin/amd64/jmap
 ./bin/amd64/jps
 ./bin/amd64/jrunscript
@@ -611,7 +619,9 @@
 ./bin/jconsole
 ./bin/jdb
 ./bin/jhat
+./bin/jimage
 ./bin/jinfo
+./bin/jjs
 ./bin/jmap
 ./bin/jps
 ./bin/jrunscript
@@ -755,7 +765,9 @@
 ./bin/sparcv9/jconsole
 ./bin/sparcv9/jdb
 ./bin/sparcv9/jhat
+./bin/sparcv9/jimage
 ./bin/sparcv9/jinfo
+./bin/sparcv9/jjs
 ./bin/sparcv9/jmap
 ./bin/sparcv9/jps
 ./bin/sparcv9/jrunscript
@@ -836,7 +848,9 @@
 ./bin/jconsole.exe
 ./bin/jdb.exe
 ./bin/jhat.exe
+./bin/jimage.exe
 ./bin/jinfo.exe
+./bin/jjs.exe
 ./bin/jmap.exe
 ./bin/jps.exe
 ./bin/jrunscript.exe
@@ -930,7 +944,9 @@
 ./bin/jconsole
 ./bin/jdb
 ./bin/jhat
+./bin/jimage
 ./bin/jinfo
+./bin/jjs
 ./bin/jmap
 ./bin/jps
 ./bin/jrunscript
--- a/common/bin/unshuffle_list.txt	Wed Dec 03 14:26:07 2014 +0000
+++ b/common/bin/unshuffle_list.txt	Wed Jul 05 20:08:27 2017 +0200
@@ -1212,6 +1212,7 @@
 jdk/src/java.rmi/share/doc/stub/java/rmi/activation : jdk/src/share/doc/stub/java/rmi/activation
 jdk/src/java.rmi/unix/bin/java-rmi.cgi.sh : jdk/src/solaris/bin/java-rmi.cgi.sh
 jdk/src/java.scripting/share/classes/javax/script : jdk/src/share/classes/javax/script
+jdk/src/java.scripting/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
 jdk/src/java.security.acl/share/classes/java/security/acl : jdk/src/share/classes/java/security/acl
 jdk/src/java.security.acl/share/classes/sun/security/acl : jdk/src/share/classes/sun/security/acl
 jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c : jdk/src/share/native/sun/security/krb5/nativeccache.c
@@ -1301,7 +1302,6 @@
 jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
 jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner
 jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat
-jdk/src/jdk.dev/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
 jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner
 jdk/src/jdk.dev/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar
 jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii
--- a/corba/.hgtags	Wed Dec 03 14:26:07 2014 +0000
+++ b/corba/.hgtags	Wed Jul 05 20:08:27 2017 +0200
@@ -282,3 +282,4 @@
 7e9add74ad50841fb39dae75db56374aefa1de4c jdk9-b37
 8acf056126e819cf536eef02aee0f61f207a6b52 jdk9-b38
 53bf36cb722db50815712258a77cb6bbe25a2f5f jdk9-b39
+e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40
--- a/corba/make/CommonCorba.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-################################################################################
-# The Corba sources are old and generates a LOT of warnings.
-# Disable these using Xlint, until someone cares to fix them.
-DISABLE_CORBA_WARNINGS := -Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,-cast,-rawtypes,-static,-dep-ann
-
-# The "generate old bytecode" javac setup uses the new compiler to compile for the
-# boot jdk to generate tools that need to be run with the boot jdk.
-# Thus we force the target bytecode to the boot jdk bytecode.
-$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
-    JVM := $(JAVA), \
-    JAVAC := $(NEW_JAVAC), \
-    FLAGS := $(BOOT_JDK_SOURCETARGET) \
-         -bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(BOOT_TOOLSJAR)" \
-         $(DISABLE_CORBA_WARNINGS), \
-    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
-    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-# The "generate new bytecode" uses the new compiler to generate bytecode
-# for the new jdk that is being built. The code compiled by this setup
-# cannot necessarily be run with the boot jdk.
-$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE, \
-    JVM := $(JAVA), \
-    JAVAC := $(NEW_JAVAC), \
-    FLAGS := -cp $(BOOT_TOOLSJAR) -XDignore.symbol.file=true $(DISABLE_CORBA_WARNINGS), \
-    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
-    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-################################################################################
--- a/corba/make/CompileCorba.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# This must be the first rule
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-
-include CommonCorba.gmk
-
-################################################################################
-
-$(eval $(call SetupJavaCompilation,BUILD_INTERIM_CORBA, \
-    SETUP := GENERATE_OLDBYTECODE, \
-    SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes \
-      $(CORBA_TOPDIR)/src/jdk.rmic/share/classes \
-      $(CORBA_OUTPUTDIR)/gensrc/java.corba, \
-    EXCLUDES := com/sun/corba/se/PortableActivationIDL, \
-    EXCLUDE_FILES := com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \
-        com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \
-        org/omg/PortableInterceptor/UNKNOWN.java \
-        com/sun/tools/corba/se/idl/ResourceBundleUtil.java \
-        com/sun/corba/se/impl/presentation/rmi/jndi.properties, \
-    COPY := .prp, \
-    CLEAN := .properties, \
-    BIN := $(CORBA_OUTPUTDIR)/interim_classes, \
-    JAR := $(INTERIM_CORBA_JAR)))
-
-################################################################################
-# Copy idl files straight to jdk/include.
-$(JDK_OUTPUTDIR)/include/%: $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/%
-	$(install-file)
-
-IDL_TARGET_FILES := $(JDK_OUTPUTDIR)/include/orb.idl $(JDK_OUTPUTDIR)/include/ir.idl
-
-################################################################################
-
-all: $(BUILD_INTERIM_CORBA) $(IDL_TARGET_FILES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/make/CompileInterim.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# This must be the first rule
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+
+################################################################################
+
+$(eval $(call SetupJavaCompilation,BUILD_INTERIM_CORBA, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(JDK_TOPDIR)/src/jdk.rmic/share/classes \
+      $(CORBA_TOPDIR)/src/java.corba/share/classes \
+      $(CORBA_TOPDIR)/src/jdk.rmic/share/classes \
+      $(SUPPORT_OUTPUTDIR)/gensrc/java.corba, \
+    EXCLUDES := com/sun/corba/se/PortableActivationIDL, \
+    EXCLUDE_FILES := com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \
+        com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \
+        org/omg/PortableInterceptor/UNKNOWN.java \
+        com/sun/tools/corba/se/idl/ResourceBundleUtil.java \
+        com/sun/corba/se/impl/presentation/rmi/jndi.properties, \
+    COPY := .prp, \
+    CLEAN := .properties, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/corba_interim_classes, \
+    JAR := $(INTERIM_CORBA_JAR)))
+
+################################################################################
+
+all: $(BUILD_INTERIM_CORBA)
--- a/corba/make/GensrcCorba.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-include IdlCompilation.gmk
-
-include CommonCorba.gmk
-
-################################################################################
-
-$(eval $(call SetupJavaCompilation,BUILD_TOOLS_CORBA, \
-    SETUP := GENERATE_OLDBYTECODE, \
-    SRC := $(CORBA_TOPDIR)/make/src/classes, \
-    BIN := $(CORBA_OUTPUTDIR)/tools_classes))
-
-TOOL_LOGUTIL_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/tools_classes \
-    build.tools.logutil.MC
-
-$(eval $(call SetupJavaCompilation,BUILD_IDLJ, \
-    SETUP := GENERATE_OLDBYTECODE, \
-    SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
-    BIN := $(CORBA_OUTPUTDIR)/idlj_classes, \
-    COPY := .prp, \
-    INCLUDES := com/sun/tools/corba/se/idl, \
-    EXCLUDE_FILES := ResourceBundleUtil.java))
-
-# Force the language to english for predictable source code generation.
-TOOL_IDLJ_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/idlj_classes \
-    -Duser.language=en com.sun.tools.corba.se.idl.toJavaPortable.Compile
-
-################################################################################
-
-# Generate LogWrapper classes
-$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/%SystemException.java: \
-    $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
-    $(BUILD_TOOLS_CORBA)
-	$(MKDIR) -p $(@D)
-	$(RM) -f $(@D)/_the_wrappers.d
-	$(ECHO) $(LOG_INFO) Generating class file from $*.mc
-	$(TOOL_LOGUTIL_CMD) make-class $< $(@D)
-
-# Generate LogWrapper properties file by concatening resource files
-$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/LogStrings.properties: \
-    $(CORBA_OUTPUTDIR)/logwrappers/ActivationSystemException.resource \
-    $(CORBA_OUTPUTDIR)/logwrappers/IORSystemException.resource \
-    $(CORBA_OUTPUTDIR)/logwrappers/InterceptorsSystemException.resource \
-    $(CORBA_OUTPUTDIR)/logwrappers/NamingSystemException.resource \
-    $(CORBA_OUTPUTDIR)/logwrappers/OMGSystemException.resource \
-    $(CORBA_OUTPUTDIR)/logwrappers/ORBUtilSystemException.resource \
-    $(CORBA_OUTPUTDIR)/logwrappers/POASystemException.resource \
-    $(CORBA_OUTPUTDIR)/logwrappers/UtilSystemException.resource
-	$(MKDIR) -p $(@D)
-	$(ECHO) $(LOG_INFO) Concatenating 8 resource files into $(@F)
-	$(CAT) $^ > $@
-
-# The resources files are generated from lisp-like .mc files.
-$(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource: \
-    $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
-    $(BUILD_TOOLS_CORBA)
-	$(MKDIR) -p $(@D)
-	$(RM) -f $(@D)/_the_wrappers.d
-	$(ECHO) $(LOG_INFO) Generating resource file from $*.mc
-	$(TOOL_LOGUTIL_CMD) make-resource $< $(@D)
-
-
-LOGWRAPPER_TARGETS := \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/ActivationSystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/IORSystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/InterceptorsSystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/NamingSystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/OMGSystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/ORBUtilSystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/POASystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/UtilSystemException.java \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/LogStrings.properties
-
-################################################################################
-# Build the IDLs.
-
-IDL_DELETES := \
-    org/omg/DynamicAny/*POA* \
-    org/omg/DynamicAny/*Holder* \
-    org/omg/DynamicAny/DynValueBoxHelper.java \
-    org/omg/DynamicAny/DynValueCommonHelper.java \
-    org/omg/DynamicAny/_DynValueCommonStub.java \
-    org/omg/DynamicAny/_DynValueBoxStub.java \
-    org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.java \
-    org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.java \
-    org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.java \
-    org/omg/IOP/BI_DIR_IIOP.java \
-    org/omg/IOP/ChainBypassCheck.java \
-    org/omg/IOP/ChainBypassInfo.java \
-    org/omg/IOP/FORWARDED_IDENTITY.java \
-    org/omg/IOP/INVOCATION_POLICIES.java \
-    org/omg/IOP/LogicalThreadId.java \
-    org/omg/IOP/SendingContextRunTime.java \
-    org/omg/IOP/UnknownExceptionInfo.java \
-    org/omg/IOP/TaggedComponentSeqHolder.java \
-    org/omg/PortableServer/CurrentPackage/NoContextHolder.java \
-    org/omg/PortableServer/ForwardRequestHolder.java \
-    org/omg/PortableServer/IdAssignmentPolicyValueHelper.java \
-    org/omg/PortableServer/IdAssignmentPolicyValueHolder.java \
-    org/omg/PortableServer/IdUniquenessPolicyValueHelper.java \
-    org/omg/PortableServer/IdUniquenessPolicyValueHolder.java \
-    org/omg/PortableServer/ImplicitActivationPolicyValueHelper.java \
-    org/omg/PortableServer/ImplicitActivationPolicyValueHolder.java \
-    org/omg/PortableServer/LifespanPolicyValueHelper.java \
-    org/omg/PortableServer/LifespanPolicyValueHolder.java \
-    org/omg/PortableServer/ServantRetentionPolicyValueHelper.java \
-    org/omg/PortableServer/ServantRetentionPolicyValueHolder.java \
-    org/omg/PortableServer/ObjectIdHelper.java \
-    org/omg/PortableServer/ObjectIdHolder.java \
-    org/omg/PortableServer/POAListHelper.java \
-    org/omg/PortableServer/POAListHolder.java \
-    org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.java \
-    org/omg/PortableServer/POAManagerPackage/StateHelper.java \
-    org/omg/PortableServer/POAManagerPackage/StateHolder.java \
-    org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.java \
-    org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.java \
-    org/omg/PortableServer/POAPackage/InvalidPolicyHolder.java \
-    org/omg/PortableServer/POAPackage/NoServantHolder.java \
-    org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.java \
-    org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.java \
-    org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.java \
-    org/omg/PortableServer/POAPackage/ServantNotActiveHolder.java \
-    org/omg/PortableServer/POAPackage/WrongAdapterHolder.java \
-    org/omg/PortableServer/POAPackage/WrongPolicyHolder.java \
-    org/omg/PortableServer/RequestProcessingPolicyValueHelper.java \
-    org/omg/PortableServer/RequestProcessingPolicyValueHolder.java \
-    org/omg/PortableServer/ServantActivatorHolder.java \
-    org/omg/PortableServer/ServantLocatorHolder.java \
-    org/omg/PortableServer/ThreadPolicyValueHelper.java \
-    org/omg/PortableServer/ThreadPolicyValueHolder.java \
-    org/omg/PortableInterceptor/ClientRequestInfoHelper.java \
-    org/omg/PortableInterceptor/ClientRequestInterceptorHelper.java \
-    org/omg/PortableInterceptor/IORInfoHelper.java \
-    org/omg/PortableInterceptor/IORInterceptorHelper.java \
-    org/omg/PortableInterceptor/InterceptorHelper.java \
-    org/omg/PortableInterceptor/ORBInitInfoHelper.java \
-    org/omg/PortableInterceptor/ORBInitializerHelper.java \
-    org/omg/PortableInterceptor/PolicyFactoryHelper.java \
-    org/omg/PortableInterceptor/ReplyStatusHelper.java \
-    org/omg/PortableInterceptor/RequestInfoHelper.java \
-    org/omg/PortableInterceptor/ServerRequestInfoHelper.java \
-    org/omg/PortableInterceptor/ServerRequestInterceptorHelper.java \
-    org/omg/PortableInterceptor/SlotIdHelper.java \
-    org/omg/PortableInterceptor/ClientRequestInfoHolder.java \
-    org/omg/PortableInterceptor/ClientRequestInterceptorHolder.java \
-    org/omg/PortableInterceptor/CurrentHolder.java \
-    org/omg/PortableInterceptor/ForwardRequestHolder.java \
-    org/omg/PortableInterceptor/IORInfoHolder.java \
-    org/omg/PortableInterceptor/IORInterceptorHolder.java \
-    org/omg/PortableInterceptor/InterceptorHolder.java \
-    org/omg/PortableInterceptor/InvalidSlotHolder.java \
-    org/omg/PortableInterceptor/ORBInitInfoHolder.java \
-    org/omg/PortableInterceptor/ORBInitializerHolder.java \
-    org/omg/PortableInterceptor/PolicyFactoryHolder.java \
-    org/omg/PortableInterceptor/RequestInfoHolder.java \
-    org/omg/PortableInterceptor/ServerRequestInfoHolder.java \
-    org/omg/PortableInterceptor/ServerRequestInterceptorHolder.java \
-    org/omg/PortableInterceptor/TaggedComponentSeqHolder.java \
-    org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHolder.java \
-    org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHolder.java \
-    org/omg/IOP/CodecPackage/FormatMismatchHolder.java \
-    org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.java \
-    org/omg/IOP/CodecPackage/TypeMismatchHolder.java \
-    org/omg/IOP/CodecHelper.java \
-    org/omg/IOP/EncodingFormatHelper.java \
-    org/omg/IOP/EncodingHelper.java \
-    org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.java \
-    org/omg/IOP/CodecFactoryHolder.java \
-    org/omg/IOP/CodecHolder.java \
-    org/omg/IOP/EncodingHolder.java \
-    org/omg/IOP/TaggedComponentSeqHelper.java \
-    org/omg/Dynamic/ContextListHelper.java \
-    org/omg/Dynamic/ExceptionListHelper.java \
-    org/omg/Dynamic/ParameterHolder.java \
-    org/omg/Dynamic/ParameterListHolder.java \
-    org/omg/Dynamic/ExceptionListHolder.java \
-    org/omg/Dynamic/ParameterHelper.java \
-    org/omg/Dynamic/ParameterListHelper.java \
-    org/omg/Dynamic/RequestContextHelper.java \
-    org/omg/CORBA/OctetSeqHelper.java \
-    org/omg/CORBA/OctetSeqHolder.java \
-    org/omg/CORBA/PolicyError.java \
-    org/omg/CORBA/RepositoryIdHelper.java \
-    #
-
-$(eval $(call SetupIdlCompilation,BUILD_IDLS, \
-    IDLJ := $(TOOL_IDLJ_CMD), \
-    SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
-    BIN := $(CORBA_OUTPUTDIR)/gensrc/java.corba, \
-    EXCLUDES := com/sun/tools/corba/se/idl/% \
-        org/omg/CORBA/% \
-        com/sun/corba/se/GiopIDL/% \
-        org/omg/PortableServer/corba.idl, \
-    INCLUDES := %, \
-    OLDIMPLBASES := com/sun/corba/se/PortableActivationIDL/activation.idl \
-        com/sun/corba/se/spi/activation/activation.idl, \
-    DELETES := $(IDL_DELETES)))
-
-$(BUILD_IDLS): $(BUILD_IDLJ)
-
-################################################################################
-# zh_HK is just a copy of zh_TW
-
-$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties: \
-    $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties
-	$(install-file)
-
-################################################################################
-
-all: $(BUILD_IDLS) $(LOGWRAPPER_TARGETS) \
-    $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/make/copy/Copy-java.corba.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Copy idl files to jdk/lib.
+$(eval $(call SetupCopyFiles,COPY_IDL, \
+    SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl, \
+    DEST := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE), \
+    FILES := $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/orb.idl \
+        $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ir.idl))
+
+TARGETS := $(COPY_IDL)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/make/gensrc/Gensrc-java.corba.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -0,0 +1,243 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include IdlCompilation.gmk
+include SetupJavaCompilers.gmk
+
+################################################################################
+
+$(eval $(call SetupJavaCompilation,BUILD_TOOLS_CORBA, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(CORBA_TOPDIR)/make/src/classes, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes))
+
+TOOL_LOGUTIL_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes \
+    build.tools.logutil.MC
+
+$(eval $(call SetupJavaCompilation,BUILD_IDLJ, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/idlj_classes, \
+    COPY := .prp, \
+    INCLUDES := com/sun/tools/corba/se/idl, \
+    EXCLUDE_FILES := ResourceBundleUtil.java))
+
+# Force the language to english for predictable source code generation.
+TOOL_IDLJ_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/idlj_classes \
+    -Duser.language=en com.sun.tools.corba.se.idl.toJavaPortable.Compile
+
+################################################################################
+
+EXCEPTION_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging
+LOGWRAPPER_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/_logwrappers
+
+# Generate LogWrapper classes
+$(EXCEPTION_DIR)/%SystemException.java: \
+    $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
+    $(BUILD_TOOLS_CORBA)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $(@D)/_the_wrappers.d
+	$(ECHO) $(LOG_INFO) Generating class file from $*.mc
+	$(TOOL_LOGUTIL_CMD) make-class $< $(@D)
+
+# Generate LogWrapper properties file by concatening resource files
+$(EXCEPTION_DIR)/LogStrings.properties: \
+    $(LOGWRAPPER_DIR)/ActivationSystemException.resource \
+    $(LOGWRAPPER_DIR)/IORSystemException.resource \
+    $(LOGWRAPPER_DIR)/InterceptorsSystemException.resource \
+    $(LOGWRAPPER_DIR)/NamingSystemException.resource \
+    $(LOGWRAPPER_DIR)/OMGSystemException.resource \
+    $(LOGWRAPPER_DIR)/ORBUtilSystemException.resource \
+    $(LOGWRAPPER_DIR)/POASystemException.resource \
+    $(LOGWRAPPER_DIR)/UtilSystemException.resource
+	$(MKDIR) -p $(@D)
+	$(ECHO) $(LOG_INFO) Concatenating 8 resource files into $(@F)
+	$(CAT) $^ > $@
+
+# The resources files are generated from lisp-like .mc files.
+$(LOGWRAPPER_DIR)/%SystemException.resource: \
+    $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
+    $(BUILD_TOOLS_CORBA)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $(@D)/_the_wrappers.d
+	$(ECHO) $(LOG_INFO) Generating resource file from $*.mc
+	$(TOOL_LOGUTIL_CMD) make-resource $< $(@D)
+
+
+LOGWRAPPER_TARGETS := \
+    $(EXCEPTION_DIR)/ActivationSystemException.java \
+    $(EXCEPTION_DIR)/IORSystemException.java \
+    $(EXCEPTION_DIR)/InterceptorsSystemException.java \
+    $(EXCEPTION_DIR)/NamingSystemException.java \
+    $(EXCEPTION_DIR)/OMGSystemException.java \
+    $(EXCEPTION_DIR)/ORBUtilSystemException.java \
+    $(EXCEPTION_DIR)/POASystemException.java \
+    $(EXCEPTION_DIR)/UtilSystemException.java \
+    $(EXCEPTION_DIR)/LogStrings.properties
+
+################################################################################
+# Build the IDLs.
+
+IDL_DELETES := \
+    org/omg/DynamicAny/*POA* \
+    org/omg/DynamicAny/*Holder* \
+    org/omg/DynamicAny/DynValueBoxHelper.java \
+    org/omg/DynamicAny/DynValueCommonHelper.java \
+    org/omg/DynamicAny/_DynValueCommonStub.java \
+    org/omg/DynamicAny/_DynValueBoxStub.java \
+    org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.java \
+    org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.java \
+    org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.java \
+    org/omg/IOP/BI_DIR_IIOP.java \
+    org/omg/IOP/ChainBypassCheck.java \
+    org/omg/IOP/ChainBypassInfo.java \
+    org/omg/IOP/FORWARDED_IDENTITY.java \
+    org/omg/IOP/INVOCATION_POLICIES.java \
+    org/omg/IOP/LogicalThreadId.java \
+    org/omg/IOP/SendingContextRunTime.java \
+    org/omg/IOP/UnknownExceptionInfo.java \
+    org/omg/IOP/TaggedComponentSeqHolder.java \
+    org/omg/PortableServer/CurrentPackage/NoContextHolder.java \
+    org/omg/PortableServer/ForwardRequestHolder.java \
+    org/omg/PortableServer/IdAssignmentPolicyValueHelper.java \
+    org/omg/PortableServer/IdAssignmentPolicyValueHolder.java \
+    org/omg/PortableServer/IdUniquenessPolicyValueHelper.java \
+    org/omg/PortableServer/IdUniquenessPolicyValueHolder.java \
+    org/omg/PortableServer/ImplicitActivationPolicyValueHelper.java \
+    org/omg/PortableServer/ImplicitActivationPolicyValueHolder.java \
+    org/omg/PortableServer/LifespanPolicyValueHelper.java \
+    org/omg/PortableServer/LifespanPolicyValueHolder.java \
+    org/omg/PortableServer/ServantRetentionPolicyValueHelper.java \
+    org/omg/PortableServer/ServantRetentionPolicyValueHolder.java \
+    org/omg/PortableServer/ObjectIdHelper.java \
+    org/omg/PortableServer/ObjectIdHolder.java \
+    org/omg/PortableServer/POAListHelper.java \
+    org/omg/PortableServer/POAListHolder.java \
+    org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.java \
+    org/omg/PortableServer/POAManagerPackage/StateHelper.java \
+    org/omg/PortableServer/POAManagerPackage/StateHolder.java \
+    org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.java \
+    org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.java \
+    org/omg/PortableServer/POAPackage/InvalidPolicyHolder.java \
+    org/omg/PortableServer/POAPackage/NoServantHolder.java \
+    org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.java \
+    org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.java \
+    org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.java \
+    org/omg/PortableServer/POAPackage/ServantNotActiveHolder.java \
+    org/omg/PortableServer/POAPackage/WrongAdapterHolder.java \
+    org/omg/PortableServer/POAPackage/WrongPolicyHolder.java \
+    org/omg/PortableServer/RequestProcessingPolicyValueHelper.java \
+    org/omg/PortableServer/RequestProcessingPolicyValueHolder.java \
+    org/omg/PortableServer/ServantActivatorHolder.java \
+    org/omg/PortableServer/ServantLocatorHolder.java \
+    org/omg/PortableServer/ThreadPolicyValueHelper.java \
+    org/omg/PortableServer/ThreadPolicyValueHolder.java \
+    org/omg/PortableInterceptor/ClientRequestInfoHelper.java \
+    org/omg/PortableInterceptor/ClientRequestInterceptorHelper.java \
+    org/omg/PortableInterceptor/IORInfoHelper.java \
+    org/omg/PortableInterceptor/IORInterceptorHelper.java \
+    org/omg/PortableInterceptor/InterceptorHelper.java \
+    org/omg/PortableInterceptor/ORBInitInfoHelper.java \
+    org/omg/PortableInterceptor/ORBInitializerHelper.java \
+    org/omg/PortableInterceptor/PolicyFactoryHelper.java \
+    org/omg/PortableInterceptor/ReplyStatusHelper.java \
+    org/omg/PortableInterceptor/RequestInfoHelper.java \
+    org/omg/PortableInterceptor/ServerRequestInfoHelper.java \
+    org/omg/PortableInterceptor/ServerRequestInterceptorHelper.java \
+    org/omg/PortableInterceptor/SlotIdHelper.java \
+    org/omg/PortableInterceptor/ClientRequestInfoHolder.java \
+    org/omg/PortableInterceptor/ClientRequestInterceptorHolder.java \
+    org/omg/PortableInterceptor/CurrentHolder.java \
+    org/omg/PortableInterceptor/ForwardRequestHolder.java \
+    org/omg/PortableInterceptor/IORInfoHolder.java \
+    org/omg/PortableInterceptor/IORInterceptorHolder.java \
+    org/omg/PortableInterceptor/InterceptorHolder.java \
+    org/omg/PortableInterceptor/InvalidSlotHolder.java \
+    org/omg/PortableInterceptor/ORBInitInfoHolder.java \
+    org/omg/PortableInterceptor/ORBInitializerHolder.java \
+    org/omg/PortableInterceptor/PolicyFactoryHolder.java \
+    org/omg/PortableInterceptor/RequestInfoHolder.java \
+    org/omg/PortableInterceptor/ServerRequestInfoHolder.java \
+    org/omg/PortableInterceptor/ServerRequestInterceptorHolder.java \
+    org/omg/PortableInterceptor/TaggedComponentSeqHolder.java \
+    org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHolder.java \
+    org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHolder.java \
+    org/omg/IOP/CodecPackage/FormatMismatchHolder.java \
+    org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.java \
+    org/omg/IOP/CodecPackage/TypeMismatchHolder.java \
+    org/omg/IOP/CodecHelper.java \
+    org/omg/IOP/EncodingFormatHelper.java \
+    org/omg/IOP/EncodingHelper.java \
+    org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.java \
+    org/omg/IOP/CodecFactoryHolder.java \
+    org/omg/IOP/CodecHolder.java \
+    org/omg/IOP/EncodingHolder.java \
+    org/omg/IOP/TaggedComponentSeqHelper.java \
+    org/omg/Dynamic/ContextListHelper.java \
+    org/omg/Dynamic/ExceptionListHelper.java \
+    org/omg/Dynamic/ParameterHolder.java \
+    org/omg/Dynamic/ParameterListHolder.java \
+    org/omg/Dynamic/ExceptionListHolder.java \
+    org/omg/Dynamic/ParameterHelper.java \
+    org/omg/Dynamic/ParameterListHelper.java \
+    org/omg/Dynamic/RequestContextHelper.java \
+    org/omg/CORBA/OctetSeqHelper.java \
+    org/omg/CORBA/OctetSeqHolder.java \
+    org/omg/CORBA/PolicyError.java \
+    org/omg/CORBA/RepositoryIdHelper.java \
+    #
+
+$(eval $(call SetupIdlCompilation,BUILD_IDLS, \
+    IDLJ := $(TOOL_IDLJ_CMD), \
+    SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
+    BIN := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba, \
+    EXCLUDES := com/sun/tools/corba/se/idl/% \
+        org/omg/CORBA/% \
+        com/sun/corba/se/GiopIDL/% \
+        org/omg/PortableServer/corba.idl, \
+    INCLUDES := %, \
+    OLDIMPLBASES := com/sun/corba/se/PortableActivationIDL/activation.idl \
+        com/sun/corba/se/spi/activation/activation.idl, \
+    DELETES := $(IDL_DELETES)))
+
+$(BUILD_IDLS): $(BUILD_IDLJ)
+
+################################################################################
+# zh_HK is just a copy of zh_TW
+
+$(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties: \
+    $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties
+	$(install-file)
+
+################################################################################
+
+all: $(BUILD_IDLS) $(LOGWRAPPER_TARGETS) \
+    $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties
+
--- a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Generator.java	Wed Dec 03 14:26:07 2014 +0000
+++ b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Generator.java	Wed Jul 05 20:08:27 2017 +0200
@@ -352,7 +352,7 @@
                         env.output(Main.getText("rmic.generated", file.getPath(), Long.toString(duration)));
                     }
                     if (sourceFile) {
-                        env.parseFile(new ClassFile(file));
+                        env.parseFile(ClassFile.newClassFile(file));
                     }
                 } catch (IOException e) {
                     env.error(0, "cant.write", file.toString());
--- a/hotspot/.hgtags	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/.hgtags	Wed Jul 05 20:08:27 2017 +0200
@@ -442,3 +442,4 @@
 b1c2dd843f247a1db19e1e85eb62ca405f72dc26 jdk9-b37
 c363a8b87e477ee45d6d3cb2a36cb365141bc596 jdk9-b38
 9cb75e5e394827ccbaf2e15524108a412dc4ddc5 jdk9-b39
+6b09b3193d731e3288e2a240c504a20d0a06c766 jdk9-b40
--- a/hotspot/make/bsd/makefiles/sa.make	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/make/bsd/makefiles/sa.make	Wed Jul 05 20:08:27 2017 +0200
@@ -63,6 +63,10 @@
   SA_CLASSPATH=$(shell test -f $(ALT_SA_CLASSPATH) && echo $(ALT_SA_CLASSPATH))
 endif
 
+ifneq ($(SA_CLASSPATH),)
+  SA_CLASSPATH_ARG := -classpath $(SA_CLASSPATH)
+endif
+
 # TODO: if it's a modules image, check if SA module is installed.
 MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules
 
@@ -114,7 +118,7 @@
 # are in AGENT_FILES, so use the shell to expand them.
 # Be extra carefull to not produce too long command lines in the shell!
 	$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
-	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
+	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) $(SA_CLASSPATH_ARG) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
 	$(QUIETLY) $(REMOTE) $(COMPILE.RMIC)  -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
 	$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
 	$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -512,15 +512,13 @@
 
 #define DEFAULT_LIBPATH "/usr/lib:/lib"
 #define EXTENSIONS_DIR  "/lib/ext"
-#define ENDORSED_DIR    "/lib/endorsed"
 
   // Buffer that fits several sprintfs.
   // Note that the space for the trailing null is provided
   // by the nulls included by the sizeof operator.
   const size_t bufsize =
-    MAX3((size_t)MAXPATHLEN,  // For dll_dir & friends.
-         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR), // extensions dir
-         (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+    MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
+         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR)); // extensions dir
   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 
   // sysclasspath, java_home, dll_dir
@@ -571,15 +569,10 @@
   sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
   Arguments::set_ext_dirs(buf);
 
-  // Endorsed standards default directory.
-  sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
-  Arguments::set_endorsed_dirs(buf);
-
   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
 
 #undef DEFAULT_LIBPATH
 #undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2778,6 +2771,10 @@
   return ::read(fd, buf, nBytes);
 }
 
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+  return ::pread(fd, buf, nBytes, offset);
+}
+
 void os::naked_short_sleep(jlong ms) {
   struct timespec req;
 
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -353,7 +353,6 @@
 // Base path of extensions installed on the system.
 #define SYS_EXT_DIR     "/usr/java/packages"
 #define EXTENSIONS_DIR  "/lib/ext"
-#define ENDORSED_DIR    "/lib/endorsed"
 
 #ifndef __APPLE__
 
@@ -361,9 +360,8 @@
   // Note that the space for the colon and the trailing null are provided
   // by the nulls included by the sizeof operator.
   const size_t bufsize =
-    MAX3((size_t)MAXPATHLEN,  // For dll_dir & friends.
-         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
-         (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+    MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
+         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 
   // sysclasspath, java_home, dll_dir
@@ -425,10 +423,6 @@
   sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
   Arguments::set_ext_dirs(buf);
 
-  // Endorsed standards default directory.
-  sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
-  Arguments::set_endorsed_dirs(buf);
-
   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
 
 #else // __APPLE__
@@ -445,9 +439,8 @@
   // Note that the space for the colon and the trailing null are provided
   // by the nulls included by the sizeof operator.
   const size_t bufsize =
-    MAX3((size_t)MAXPATHLEN,  // for dll_dir & friends.
-         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + system_ext_size, // extensions dir
-         (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+    MAX2((size_t)MAXPATHLEN,  // for dll_dir & friends.
+         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + system_ext_size); // extensions dir
   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 
   // sysclasspath, java_home, dll_dir
@@ -525,10 +518,6 @@
           user_home_dir, Arguments::get_java_home());
   Arguments::set_ext_dirs(buf);
 
-  // Endorsed standards default directory.
-  sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
-  Arguments::set_endorsed_dirs(buf);
-
   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
 
 #undef SYS_EXTENSIONS_DIR
@@ -538,7 +527,6 @@
 
 #undef SYS_EXT_DIR
 #undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2576,6 +2564,10 @@
   RESTARTABLE_RETURN_INT(::read(fd, buf, nBytes));
 }
 
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+  RESTARTABLE_RETURN_INT(::pread(fd, buf, nBytes, offset));
+}
+
 void os::naked_short_sleep(jlong ms) {
   struct timespec req;
 
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -337,15 +337,13 @@
 // Base path of extensions installed on the system.
 #define SYS_EXT_DIR     "/usr/java/packages"
 #define EXTENSIONS_DIR  "/lib/ext"
-#define ENDORSED_DIR    "/lib/endorsed"
 
   // Buffer that fits several sprintfs.
   // Note that the space for the colon and the trailing null are provided
   // by the nulls included by the sizeof operator.
   const size_t bufsize =
-    MAX3((size_t)MAXPATHLEN,  // For dll_dir & friends.
-         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
-         (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+    MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
+         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 
   // sysclasspath, java_home, dll_dir
@@ -410,16 +408,11 @@
   sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
   Arguments::set_ext_dirs(buf);
 
-  // Endorsed standards default directory.
-  sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
-  Arguments::set_endorsed_dirs(buf);
-
   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
 
 #undef DEFAULT_LIBPATH
 #undef SYS_EXT_DIR
 #undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -3783,6 +3776,10 @@
   return ::read(fd, buf, nBytes);
 }
 
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+  return ::pread(fd, buf, nBytes, offset);
+}
+
 // Short sleep, direct OS call.
 //
 // Note: certain versions of Linux CFS scheduler (since 2.6.23) do not guarantee
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -609,17 +609,15 @@
 // Base path of extensions installed on the system.
 #define SYS_EXT_DIR     "/usr/jdk/packages"
 #define EXTENSIONS_DIR  "/lib/ext"
-#define ENDORSED_DIR    "/lib/endorsed"
 
   char cpu_arch[12];
   // Buffer that fits several sprintfs.
   // Note that the space for the colon and the trailing null are provided
   // by the nulls included by the sizeof operator.
   const size_t bufsize =
-    MAX4((size_t)MAXPATHLEN,  // For dll_dir & friends.
+    MAX3((size_t)MAXPATHLEN,  // For dll_dir & friends.
          sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch), // invariant ld_library_path
-         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
-         (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 
   // sysclasspath, java_home, dll_dir
@@ -765,15 +763,10 @@
   sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
   Arguments::set_ext_dirs(buf);
 
-  // Endorsed standards default directory.
-  sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
-  Arguments::set_endorsed_dirs(buf);
-
   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
 
 #undef SYS_EXT_DIR
 #undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
 }
 
 void os::breakpoint() {
@@ -3164,6 +3157,15 @@
   return res;
 }
 
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+  size_t res;
+  JavaThread* thread = (JavaThread*)Thread::current();
+  assert(thread->thread_state() == _thread_in_vm, "Assumed _thread_in_vm");
+  ThreadBlockInVM tbiv(thread);
+  RESTARTABLE(::pread(fd, buf, (size_t) nBytes, offset), res);
+  return res;
+}
+
 size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
   size_t res;
   assert(((JavaThread*)Thread::current())->thread_state() == _thread_in_native,
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -292,19 +292,6 @@
   #undef BIN_DIR
   #undef PACKAGE_DIR
 
-  // Default endorsed standards directory.
-  {
-#define ENDORSED_DIR "\\lib\\endorsed"
-    size_t len = strlen(Arguments::get_java_home()) + sizeof(ENDORSED_DIR);
-    char * buf = NEW_C_HEAP_ARRAY(char, len, mtInternal);
-    sprintf(buf, "%s%s", Arguments::get_java_home(), ENDORSED_DIR);
-    Arguments::set_endorsed_dirs(buf);
-    // (Arguments::set_endorsed_dirs() calls SystemProperty::set_value(), which
-    //  duplicates the input.)
-    FREE_C_HEAP_ARRAY(char, buf, mtInternal);
-#undef ENDORSED_DIR
-  }
-
 #ifndef _WIN64
   // set our UnhandledExceptionFilter and save any previous one
   prev_uef_handler = SetUnhandledExceptionFilter(Handle_FLT_Exception);
@@ -4376,6 +4363,23 @@
   return (jlong) ::_lseeki64(fd, offset, whence);
 }
 
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+  OVERLAPPED ov;
+  DWORD nread;
+  BOOL result;
+
+  ZeroMemory(&ov, sizeof(ov));
+  ov.Offset = (DWORD)offset;
+  ov.OffsetHigh = (DWORD)(offset >> 32);
+
+  HANDLE h = (HANDLE)::_get_osfhandle(fd);
+
+  result = ReadFile(h, (LPVOID)buf, nBytes, &nread, &ov);
+
+  return result ? nread : 0;
+}
+
+
 // This method is a slightly reworked copy of JDK's sysNativePath
 // from src/windows/hpi/src/path_md.c
 
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -28,6 +28,7 @@
 #include "classfile/classLoader.hpp"
 #include "classfile/classLoaderExt.hpp"
 #include "classfile/classLoaderData.inline.hpp"
+#include "classfile/imageFile.hpp"
 #include "classfile/javaClasses.hpp"
 #if INCLUDE_CDS
 #include "classfile/sharedPathsMiscInfo.hpp"
@@ -67,7 +68,7 @@
 #include "utilities/hashtable.hpp"
 #include "utilities/hashtable.inline.hpp"
 
-// Entry points in zip.dll for loading zip/jar file entries
+// Entry points in zip.dll for loading zip/jar file entries and image file entries
 
 typedef void * * (JNICALL *ZipOpen_t)(const char *name, char **pmsg);
 typedef void (JNICALL *ZipClose_t)(jzfile *zip);
@@ -75,6 +76,7 @@
 typedef jboolean (JNICALL *ReadEntry_t)(jzfile *zip, jzentry *entry, unsigned char *buf, char *namebuf);
 typedef jboolean (JNICALL *ReadMappedEntry_t)(jzfile *zip, jzentry *entry, unsigned char **buf, char *namebuf);
 typedef jzentry* (JNICALL *GetNextEntry_t)(jzfile *zip, jint n);
+typedef jboolean (JNICALL *ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
 typedef jint     (JNICALL *Crc32_t)(jint crc, const jbyte *buf, jint len);
 
 static ZipOpen_t         ZipOpen            = NULL;
@@ -84,6 +86,7 @@
 static ReadMappedEntry_t ReadMappedEntry    = NULL;
 static GetNextEntry_t    GetNextEntry       = NULL;
 static canonicalize_fn_t CanonicalizeEntry  = NULL;
+static ZipInflateFully_t ZipInflateFully    = NULL;
 static Crc32_t           Crc32              = NULL;
 
 // Globals
@@ -322,6 +325,8 @@
 }
 
 bool LazyClassPathEntry::is_jar_file() {
+  size_t len = strlen(_path);
+  if (len < 4 || strcmp(_path + len - 4, ".jar") != 0) return false;
   return ((_st.st_mode & S_IFREG) == S_IFREG);
 }
 
@@ -385,6 +390,78 @@
   }
 }
 
+ClassPathImageEntry::ClassPathImageEntry(char* name) : ClassPathEntry(), _image(new ImageFile(name)) {
+  bool opened = _image->open();
+  if (!opened) {
+    _image = NULL;
+  }
+}
+
+ClassPathImageEntry::~ClassPathImageEntry() {
+  if (_image) {
+    _image->close();
+    _image = NULL;
+  }
+}
+
+const char* ClassPathImageEntry::name() {
+  return _image ? _image->name() : "";
+}
+
+ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) {
+  u1* buffer;
+  u8 size;
+  _image->get_resource(name, buffer, size);
+
+  if (buffer) {
+    if (UsePerfData) {
+      ClassLoader::perf_sys_classfile_bytes_read()->inc(size);
+    }
+    return new ClassFileStream(buffer, (int)size, (char*)name);  // Resource allocated
+  }
+
+  return NULL;
+}
+
+#ifndef PRODUCT
+void ClassPathImageEntry::compile_the_world(Handle loader, TRAPS) {
+  tty->print_cr("CompileTheWorld : Compiling all classes in %s", name());
+  tty->cr();
+  const ImageStrings strings = _image->get_strings();
+  // Retrieve each path component string.
+  u4 count = _image->get_location_count();
+  for (u4 i = 0; i < count; i++) {
+    u1* location_data = _image->get_location_data(i);
+
+    if (location_data) {
+       ImageLocation location(location_data);
+       const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
+       const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
+       const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
+       assert((strlen(parent) + strlen(base) + strlen(extension)) < JVM_MAXPATHLEN, "path exceeds buffer");
+       char path[JVM_MAXPATHLEN];
+       strcpy(path, parent);
+       strcat(path, base);
+       strcat(path, extension);
+       ClassLoader::compile_the_world_in(path, loader, CHECK);
+    }
+  }
+  if (HAS_PENDING_EXCEPTION) {
+  if (PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
+    CLEAR_PENDING_EXCEPTION;
+    tty->print_cr("\nCompileTheWorld : Ran out of memory\n");
+    tty->print_cr("Increase class metadata storage if a limit was set");
+  } else {
+    tty->print_cr("\nCompileTheWorld : Unexpected exception occurred\n");
+  }
+  }
+}
+
+bool ClassPathImageEntry::is_jrt() {
+  return string_ends_with(name(), "bootmodules.jimage");
+}
+#endif
+
 static void print_meta_index(LazyClassPathEntry* entry,
                              GrowableArray<char*>& meta_packages) {
   tty->print("[Meta index for %s=", entry->name());
@@ -634,7 +711,7 @@
   }
   ClassPathEntry* new_entry = NULL;
   if ((st->st_mode & S_IFREG) == S_IFREG) {
-    // Regular file, should be a zip file
+    // Regular file, should be a zip or image file
     // Canonicalized filename
     char canonical_path[JVM_MAXPATHLEN];
     if (!get_canonical_path(path, canonical_path, JVM_MAXPATHLEN)) {
@@ -645,6 +722,11 @@
         return NULL;
       }
     }
+    // TODO - add proper criteria for selecting image file
+    ClassPathImageEntry* entry = new ClassPathImageEntry(canonical_path);
+    if (entry->is_open()) {
+      new_entry = entry;
+    } else {
     char* error_msg = NULL;
     jzfile* zip;
     {
@@ -655,9 +737,6 @@
     }
     if (zip != NULL && error_msg == NULL) {
       new_entry = new ClassPathZipEntry(zip, path);
-      if (TraceClassLoading || TraceClassPaths) {
-        tty->print_cr("[Opened %s]", path);
-      }
     } else {
       ResourceMark rm(thread);
       char *msg;
@@ -675,10 +754,14 @@
         return NULL;
       }
     }
+    }
+    if (TraceClassLoading || TraceClassPaths) {
+      tty->print_cr("[Opened %s]", path);
+    }
   } else {
     // Directory
     new_entry = new ClassPathDirEntry(path);
-    if (TraceClassLoading || TraceClassPaths) {
+    if (TraceClassLoading) {
       tty->print_cr("[Path %s]", path);
     }
   }
@@ -801,6 +884,7 @@
   ReadEntry    = CAST_TO_FN_PTR(ReadEntry_t, os::dll_lookup(handle, "ZIP_ReadEntry"));
   ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, os::dll_lookup(handle, "ZIP_ReadMappedEntry"));
   GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, os::dll_lookup(handle, "ZIP_GetNextEntry"));
+  ZipInflateFully = CAST_TO_FN_PTR(ZipInflateFully_t, os::dll_lookup(handle, "ZIP_InflateFully"));
   Crc32        = CAST_TO_FN_PTR(Crc32_t, os::dll_lookup(handle, "ZIP_CRC32"));
 
   // ZIP_Close is not exported on Windows in JDK5.0 so don't abort if ZIP_Close is NULL
@@ -809,12 +893,20 @@
     vm_exit_during_initialization("Corrupted ZIP library", path);
   }
 
+  if (ZipInflateFully == NULL) {
+    vm_exit_during_initialization("Corrupted ZIP library ZIP_InflateFully missing", path);
+  }
+
   // Lookup canonicalize entry in libjava.dll
   void *javalib_handle = os::native_java_library();
   CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, os::dll_lookup(javalib_handle, "Canonicalize"));
   // This lookup only works on 1.3. Do not check for non-null here
 }
 
+jboolean ClassLoader::decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg) {
+  return (*ZipInflateFully)(in, inSize, out, outSize, pmsg);
+}
+
 int ClassLoader::crc32(int crc, const char* buf, int len) {
   assert(Crc32 != NULL, "ZIP_CRC32 is not found");
   return (*Crc32)(crc, (const jbyte*)buf, len);
@@ -1367,8 +1459,7 @@
   tty->cr();
 }
 
-
-bool ClassPathDirEntry::is_rt_jar() {
+bool ClassPathDirEntry::is_jrt() {
   return false;
 }
 
@@ -1393,13 +1484,13 @@
   }
 }
 
-bool ClassPathZipEntry::is_rt_jar() {
+bool ClassPathZipEntry::is_jrt() {
   real_jzfile* zip = (real_jzfile*) _zip;
   int len = (int)strlen(zip->name);
   // Check whether zip name ends in "rt.jar"
   // This will match other archives named rt.jar as well, but this is
   // only used for debugging.
-  return (len >= 6) && (strcasecmp(zip->name + len - 6, "rt.jar") == 0);
+  return string_ends_with(zip->name, "rt.jar");
 }
 
 void LazyClassPathEntry::compile_the_world(Handle loader, TRAPS) {
@@ -1409,7 +1500,7 @@
   }
 }
 
-bool LazyClassPathEntry::is_rt_jar() {
+bool LazyClassPathEntry::is_jrt() {
   Thread* THREAD = Thread::current();
   ClassPathEntry* cpe = resolve_entry(THREAD);
   return (cpe != NULL) ? cpe->is_jar_file() : false;
@@ -1428,7 +1519,7 @@
   jlong start = os::javaTimeMillis();
   while (e != NULL) {
     // We stop at rt.jar, unless it is the first bootstrap path entry
-    if (e->is_rt_jar() && e != _first_entry) break;
+    if (e->is_jrt() && e != _first_entry) break;
     e->compile_the_world(system_class_loader, CATCH);
     e = e->next();
   }
@@ -1476,9 +1567,9 @@
 }
 
 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
-  int len = (int)strlen(name);
-  if (len > 6 && strcmp(".class", name + len - 6) == 0) {
+  if (string_ends_with(name, ".class")) {
     // We have a .class file
+    int len = (int)strlen(name);
     char buffer[2048];
     strncpy(buffer, name, len - 6);
     buffer[len-6] = 0;
--- a/hotspot/src/share/vm/classfile/classLoader.hpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp	Wed Jul 05 20:08:27 2017 +0200
@@ -66,7 +66,7 @@
   virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
   // Debugging
   NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
-  NOT_PRODUCT(virtual bool is_rt_jar() = 0;)
+  NOT_PRODUCT(virtual bool is_jrt() = 0;)
 };
 
 
@@ -80,7 +80,7 @@
   ClassFileStream* open_stream(const char* name, TRAPS);
   // Debugging
   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
-  NOT_PRODUCT(bool is_rt_jar();)
+  NOT_PRODUCT(bool is_jrt();)
 };
 
 
@@ -112,7 +112,7 @@
   void contents_do(void f(const char* name, void* context), void* context);
   // Debugging
   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
-  NOT_PRODUCT(bool is_rt_jar();)
+  NOT_PRODUCT(bool is_jrt();)
 };
 
 
@@ -138,7 +138,25 @@
   virtual bool is_lazy();
   // Debugging
   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
-  NOT_PRODUCT(bool is_rt_jar();)
+  NOT_PRODUCT(bool is_jrt();)
+};
+
+// For java image files
+class ImageFile;
+class ClassPathImageEntry: public ClassPathEntry {
+private:
+  ImageFile *_image;
+public:
+  bool is_jar_file()  { return false;  }
+  bool is_open()  { return _image != NULL; }
+  const char* name();
+  ClassPathImageEntry(char* name);
+  ~ClassPathImageEntry();
+  ClassFileStream* open_stream(const char* name, TRAPS);
+
+  // Debugging
+  NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
+  NOT_PRODUCT(bool is_jrt();)
 };
 
 class PackageHashtable;
@@ -226,6 +244,7 @@
   // to avoid confusing the zip library
   static bool get_canonical_path(const char* orig, char* out, int len);
  public:
+  static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg);
   static int crc32(int crc, const char* buf, int len);
   static bool update_class_path_entry_list(const char *path,
                                            bool check_for_duplicates,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/imageFile.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "classfile/imageFile.hpp"
+#include "runtime/os.inline.hpp"
+#include "utilities/bytes.hpp"
+
+
+// Compute the Perfect Hashing hash code for the supplied string.
+u4 ImageStrings::hash_code(const char* string, u4 seed) {
+  u1* bytes = (u1*)string;
+
+  // Compute hash code.
+  for (u1 byte = *bytes++; byte; byte = *bytes++) {
+    seed = (seed * HASH_MULTIPLIER) ^ byte;
+  }
+
+  // Ensure the result is unsigned.
+  return seed & 0x7FFFFFFF;
+}
+
+// Test to see if string begins with start.  If so returns remaining portion
+// of string.  Otherwise, NULL.
+const char* ImageStrings::starts_with(const char* string, const char* start) {
+  char ch1, ch2;
+
+  // Match up the strings the best we can.
+  while ((ch1 = *string) && (ch2 = *start)) {
+    if (ch1 != ch2) {
+      // Mismatch, return NULL.
+      return NULL;
+    }
+
+    string++, start++;
+  }
+
+  // Return remainder of string.
+  return string;
+}
+
+ImageLocation::ImageLocation(u1* data) {
+  // Deflate the attribute stream into an array of attributes.
+  memset(_attributes, 0, sizeof(_attributes));
+  u1 byte;
+
+  while ((byte = *data) != ATTRIBUTE_END) {
+    u1 kind = attribute_kind(byte);
+    u1 n = attribute_length(byte);
+    assert(kind < ATTRIBUTE_COUNT, "invalid image location attribute");
+    _attributes[kind] = attribute_value(data + 1, n);
+    data += n + 1;
+  }
+}
+
+ImageFile::ImageFile(const char* name) {
+  // Copy the image file name.
+  _name = NEW_C_HEAP_ARRAY(char, strlen(name)+1, mtClass);
+  strcpy(_name, name);
+
+  // Initialize for a closed file.
+  _fd = -1;
+  _memory_mapped = true;
+  _index_data = NULL;
+}
+
+ImageFile::~ImageFile() {
+  // Ensure file is closed.
+  close();
+
+  // Free up name.
+  FREE_C_HEAP_ARRAY(char, _name, mtClass);
+}
+
+bool ImageFile::open() {
+  // If file exists open for reading.
+  struct stat st;
+  if (os::stat(_name, &st) != 0 ||
+    (st.st_mode & S_IFREG) != S_IFREG ||
+    (_fd = os::open(_name, 0, O_RDONLY)) == -1) {
+    return false;
+  }
+
+  // Read image file header and verify.
+  u8 header_size = sizeof(ImageHeader);
+  if (os::read(_fd, &_header, header_size) != header_size ||
+    _header._magic != IMAGE_MAGIC ||
+    _header._major_version != MAJOR_VERSION ||
+    _header._minor_version != MINOR_VERSION) {
+    close();
+    return false;
+  }
+
+  // Memory map index.
+  _index_size = index_size();
+  _index_data = (u1*)os::map_memory(_fd, _name, 0, NULL, _index_size, true, false);
+
+  // Failing that, read index into C memory.
+  if (_index_data == NULL) {
+    _memory_mapped = false;
+    _index_data = NEW_RESOURCE_ARRAY(u1, _index_size);
+
+    if (os::seek_to_file_offset(_fd, 0) == -1) {
+      close();
+      return false;
+    }
+
+    if (os::read(_fd, _index_data, _index_size) != _index_size) {
+      close();
+      return false;
+    }
+
+    return true;
+  }
+
+// Used to advance a pointer, unstructured.
+#undef nextPtr
+#define nextPtr(base, fromType, count, toType) (toType*)((fromType*)(base) + (count))
+  // Pull tables out from the index.
+  _redirect_table = nextPtr(_index_data, u1, header_size, s4);
+  _offsets_table = nextPtr(_redirect_table, s4, _header._location_count, u4);
+  _location_bytes = nextPtr(_offsets_table, u4, _header._location_count, u1);
+  _string_bytes = nextPtr(_location_bytes, u1, _header._locations_size, u1);
+#undef nextPtr
+
+  // Successful open.
+  return true;
+}
+
+void ImageFile::close() {
+  // Dealllocate the index.
+  if (_index_data) {
+    if (_memory_mapped) {
+      os::unmap_memory((char*)_index_data, _index_size);
+    } else {
+      FREE_RESOURCE_ARRAY(u1, _index_data, _index_size);
+    }
+
+    _index_data = NULL;
+  }
+
+  // close file.
+  if (_fd != -1) {
+    os::close(_fd);
+    _fd = -1;
+  }
+
+}
+
+// Return the attribute stream for a named resourced.
+u1* ImageFile::find_location_data(const char* path) const {
+  // Compute hash.
+  u4 hash = ImageStrings::hash_code(path) % _header._location_count;
+  s4 redirect = _redirect_table[hash];
+
+  if (!redirect) {
+    return NULL;
+  }
+
+  u4 index;
+
+  if (redirect < 0) {
+    // If no collision.
+    index = -redirect - 1;
+  } else {
+    // If collision, recompute hash code.
+    index = ImageStrings::hash_code(path, redirect) % _header._location_count;
+  }
+
+  assert(index < _header._location_count, "index exceeds location count");
+  u4 offset = _offsets_table[index];
+  assert(offset < _header._locations_size, "offset exceeds location attributes size");
+
+  if (offset == 0) {
+    return NULL;
+  }
+
+  return _location_bytes + offset;
+}
+
+// Verify that a found location matches the supplied path.
+bool ImageFile::verify_location(ImageLocation& location, const char* path) const {
+  // Retrieve each path component string.
+  ImageStrings strings(_string_bytes, _header._strings_size);
+  // Match a path with each subcomponent without concatenation (copy).
+  // Match up path parent.
+  const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
+  const char* next = ImageStrings::starts_with(path, parent);
+  // Continue only if a complete match.
+  if (!next) return false;
+  // Match up path base.
+  const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
+  next = ImageStrings::starts_with(next, base);
+  // Continue only if a complete match.
+  if (!next) return false;
+  // Match up path extension.
+  const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
+  next = ImageStrings::starts_with(next, extension);
+
+  // True only if complete match and no more characters.
+  return next && *next == '\0';
+}
+
+// Return the resource for the supplied location.
+u1* ImageFile::get_resource(ImageLocation& location) const {
+  // Retrieve the byte offset and size of the resource.
+  u8 offset = _index_size + location.get_attribute(ImageLocation::ATTRIBUTE_OFFSET);
+  u8 size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
+  u8 compressed_size = location.get_attribute(ImageLocation::ATTRIBUTE_COMPRESSED);
+  u8 read_size = compressed_size ? compressed_size : size;
+
+  // Allocate space for the resource.
+  u1* data = NEW_RESOURCE_ARRAY(u1, read_size);
+
+  bool is_read = os::read_at(_fd, data, read_size, offset) == read_size;
+  guarantee(is_read, "error reading from image or short read");
+
+  // If not compressed, just return the data.
+  if (!compressed_size) {
+    return data;
+  }
+
+  u1* uncompressed = NEW_RESOURCE_ARRAY(u1, size);
+  char* msg = NULL;
+  jboolean res = ClassLoader::decompress(data, compressed_size, uncompressed, size, &msg);
+  if (!res) warning("decompression failed due to %s\n", msg);
+  guarantee(res, "decompression failed");
+
+  return uncompressed;
+}
+
+void ImageFile::get_resource(const char* path, u1*& buffer, u8& size) const {
+  buffer = NULL;
+  size = 0;
+  u1* data = find_location_data(path);
+  if (data) {
+    ImageLocation location(data);
+    if (verify_location(location, path)) {
+      size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
+      buffer = get_resource(location);
+    }
+  }
+}
+
+GrowableArray<const char*>* ImageFile::packages(const char* name) {
+  char entry[JVM_MAXPATHLEN];
+  bool overflow = jio_snprintf(entry, sizeof(entry), "%s/packages.offsets", name) == -1;
+  guarantee(!overflow, "package name overflow");
+
+  u1* buffer;
+  u8 size;
+
+  get_resource(entry, buffer, size);
+  guarantee(buffer, "missing module packages reource");
+  ImageStrings strings(_string_bytes, _header._strings_size);
+  GrowableArray<const char*>* pkgs = new GrowableArray<const char*>();
+  int count = size / 4;
+  for (int i = 0; i < count; i++) {
+    u4 offset = Bytes::get_Java_u4(buffer + (i*4));
+    const char* p = strings.get(offset);
+    pkgs->append(p);
+  }
+
+  return pkgs;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/imageFile.hpp	Wed Jul 05 20:08:27 2017 +0200
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_IMAGEFILE_HPP
+#define SHARE_VM_CLASSFILE_IMAGEFILE_HPP
+
+#include "classfile/classLoader.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+// Image files are an alternate file format for storing classes and resources. The
+// goal is to supply file access which is faster and smaller that the jar format.
+// It should be noted that unlike jars information stored in an image is in native
+// endian format. This allows the image to be memory mapped into memory without
+// endian translation.  This also means that images are platform dependent.
+//
+// Image files are structured as three sections;
+//
+//         +-----------+
+//         |  Header   |
+//         +-----------+
+//         |           |
+//         | Directory |
+//         |           |
+//         +-----------+
+//         |           |
+//         |           |
+//         | Resources |
+//         |           |
+//         |           |
+//         +-----------+
+//
+// The header contains information related to identification and description of
+// contents.
+//
+//         +-------------------------+
+//         |   Magic (0xCAFEDADA)    |
+//         +------------+------------+
+//         | Major Vers | Minor Vers |
+//         +------------+------------+
+//         |      Location Count     |
+//         +-------------------------+
+//         |      Attributes Size    |
+//         +-------------------------+
+//         |       Strings Size      |
+//         +-------------------------+
+//
+// Magic - means of identifying validity of the file.  This avoids requiring a
+//         special file extension.
+// Major vers, minor vers - differences in version numbers indicate structural
+//                          changes in the image.
+// Location count - number of locations/resources in the file.  This count is also
+//                  the length of lookup tables used in the directory.
+// Attributes size - number of bytes in the region used to store location attribute
+//                   streams.
+// Strings size - the size of the region used to store strings used by the
+//                directory and meta data.
+//
+// The directory contains information related to resource lookup. The algorithm
+// used for lookup is "A Practical Minimal Perfect Hashing Method"
+// (http://homepages.dcc.ufmg.br/~nivio/papers/wea05.pdf). Given a path string
+// in the form <package>/<base>.<extension>  return the resource location
+// information;
+//
+//     redirectIndex = hash(path, DEFAULT_SEED) % count;
+//     redirect = redirectTable[redirectIndex];
+//     if (redirect == 0) return not found;
+//     locationIndex = redirect < 0 ? -1 - redirect : hash(path, redirect) % count;
+//     location = locationTable[locationIndex];
+//     if (!verify(location, path)) return not found;
+//     return location;
+//
+// Note: The hash function takes an initial seed value.  A different seed value
+// usually returns a different result for strings that would otherwise collide with
+// other seeds. The verify function guarantees the found resource location is
+// indeed the resource we are looking for.
+//
+// The following is the format of the directory;
+//
+//         +-------------------+
+//         |   Redirect Table  |
+//         +-------------------+
+//         | Attribute Offsets |
+//         +-------------------+
+//         |   Attribute Data  |
+//         +-------------------+
+//         |      Strings      |
+//         +-------------------+
+//
+// Redirect Table - Array of 32-bit signed values representing actions that
+//                  should take place for hashed strings that map to that
+//                  value.  Negative values indicate no hash collision and can be
+//                  quickly converted to indices into attribute offsets.  Positive
+//                  values represent a new seed for hashing an index into attribute
+//                  offsets.  Zero indicates not found.
+// Attribute Offsets - Array of 32-bit unsigned values representing offsets into
+//                     attribute data.  Attribute offsets can be iterated to do a
+//                     full survey of resources in the image.
+// Attribute Data - Bytes representing compact attribute data for locations. (See
+//                  comments in ImageLocation.)
+// Strings - Collection of zero terminated UTF-8 strings used by the directory and
+//           image meta data.  Each string is accessed by offset.  Each string is
+//           unique.  Offset zero is reserved for the empty string.
+//
+// Note that the memory mapped directory assumes 32 bit alignment of the image
+// header, the redirect table and the attribute offsets.
+//
+
+
+// Manage image file string table.
+class ImageStrings {
+private:
+  // Data bytes for strings.
+  u1* _data;
+  // Number of bytes in the string table.
+  u4 _size;
+
+public:
+  // Prime used to generate hash for Perfect Hashing.
+  static const u4 HASH_MULTIPLIER = 0x01000193;
+
+  ImageStrings(u1* data, u4 size) : _data(data), _size(size) {}
+
+  // Return the UTF-8 string beginning at offset.
+  inline const char* get(u4 offset) const {
+    assert(offset < _size, "offset exceeds string table size");
+    return (const char*)(_data + offset);
+  }
+
+  // Compute the Perfect Hashing hash code for the supplied string.
+  inline static u4 hash_code(const char* string) {
+    return hash_code(string, HASH_MULTIPLIER);
+  }
+
+  // Compute the Perfect Hashing hash code for the supplied string, starting at seed.
+  static u4 hash_code(const char* string, u4 seed);
+
+  // Test to see if string begins with start.  If so returns remaining portion
+  // of string.  Otherwise, NULL.  Used to test sections of a path without
+  // copying.
+  static const char* starts_with(const char* string, const char* start);
+
+};
+
+// Manage image file location attribute streams.  Within an image, a location's
+// attributes are compressed into a stream of bytes.  An attribute stream is
+// composed of individual attribute sequences.  Each attribute sequence begins with
+// a header byte containing the attribute 'kind' (upper 5 bits of header) and the
+// 'length' less 1 (lower 3 bits of header) of bytes that follow containing the
+// attribute value.  Attribute values present as most significant byte first.
+//
+// Ex. Container offset (ATTRIBUTE_OFFSET) 0x33562 would be represented as 0x22
+// (kind = 4, length = 3), 0x03, 0x35, 0x62.
+//
+// An attribute stream is terminated with a header kind of ATTRIBUTE_END (header
+// byte of zero.)
+//
+// ImageLocation inflates the stream into individual values stored in the long
+// array _attributes. This allows an attribute value can be quickly accessed by
+// direct indexing. Unspecified values default to zero.
+//
+// Notes:
+//  - Even though ATTRIBUTE_END is used to mark the end of the attribute stream,
+//    streams will contain zero byte values to represent lesser significant bits.
+//    Thus, detecting a zero byte is not sufficient to detect the end of an attribute
+//    stream.
+//  - ATTRIBUTE_OFFSET represents the number of bytes from the beginning of the region
+//    storing the resources.  Thus, in an image this represents the number of bytes
+//    after the directory.
+//  - Currently, compressed resources are represented by having a non-zero
+//    ATTRIBUTE_COMPRESSED value.  This represents the number of bytes stored in the
+//    image, and the value of ATTRIBUTE_UNCOMPRESSED represents number of bytes of the
+//    inflated resource in memory. If the ATTRIBUTE_COMPRESSED is zero then the value
+//    of ATTRIBUTE_UNCOMPRESSED represents both the number of bytes in the image and
+//    in memory.  In the future, additional compression techniques will be used and
+//    represented differently.
+//  - Package strings include trailing slash and extensions include prefix period.
+//
+class ImageLocation {
+public:
+  // Attribute kind enumeration.
+  static const u1 ATTRIBUTE_END = 0; // End of attribute stream marker
+  static const u1 ATTRIBUTE_BASE = 1; // String table offset of resource path base
+  static const u1 ATTRIBUTE_PARENT = 2; // String table offset of resource path parent
+  static const u1 ATTRIBUTE_EXTENSION = 3; // String table offset of resource path extension
+  static const u1 ATTRIBUTE_OFFSET = 4; // Container byte offset of resource
+  static const u1 ATTRIBUTE_COMPRESSED = 5; // In image byte size of the compressed resource
+  static const u1 ATTRIBUTE_UNCOMPRESSED = 6; // In memory byte size of the uncompressed resource
+  static const u1 ATTRIBUTE_COUNT = 7; // Number of attribute kinds
+
+private:
+  // Values of inflated attributes.
+  u8 _attributes[ATTRIBUTE_COUNT];
+
+  // Return the attribute value number of bytes.
+  inline static u1 attribute_length(u1 data) {
+    return (data & 0x7) + 1;
+  }
+
+  // Return the attribute kind.
+  inline static u1 attribute_kind(u1 data) {
+    u1 kind = data >> 3;
+    assert(kind < ATTRIBUTE_COUNT, "invalid attribute kind");
+    return kind;
+  }
+
+  // Return the attribute length.
+  inline static u8 attribute_value(u1* data, u1 n) {
+    assert(0 < n && n <= 8, "invalid attribute value length");
+    u8 value = 0;
+
+    // Most significant bytes first.
+    for (u1 i = 0; i < n; i++) {
+      value <<= 8;
+      value |= data[i];
+    }
+
+    return value;
+  }
+
+public:
+  ImageLocation(u1* data);
+
+  // Retrieve an attribute value from the inflated array.
+  inline u8 get_attribute(u1 kind) const {
+    assert(ATTRIBUTE_END < kind && kind < ATTRIBUTE_COUNT, "invalid attribute kind");
+    return _attributes[kind];
+  }
+
+  // Retrieve an attribute string value from the inflated array.
+  inline const char* get_attribute(u4 kind, const ImageStrings& strings) const {
+    return strings.get((u4)get_attribute(kind));
+  }
+};
+
+// Manage the image file.
+class ImageFile: public CHeapObj<mtClass> {
+private:
+  // Image file marker.
+  static const u4 IMAGE_MAGIC = 0xCAFEDADA;
+  // Image file major version number.
+  static const u2 MAJOR_VERSION = 0;
+  // Image file minor version number.
+  static const u2 MINOR_VERSION = 1;
+
+  struct ImageHeader {
+    u4 _magic;          // Image file marker
+    u2 _major_version;  // Image file major version number
+    u2 _minor_version;  // Image file minor version number
+    u4 _location_count; // Number of locations managed in index.
+    u4 _locations_size; // Number of bytes in attribute table.
+    u4 _strings_size;   // Number of bytes in string table.
+  };
+
+  char* _name;          // Name of image
+  int _fd;              // File descriptor
+  bool _memory_mapped;  // Is file memory mapped
+  ImageHeader _header;  // Image header
+  u8 _index_size;       // Total size of index
+  u1* _index_data;      // Raw index data
+  s4* _redirect_table;  // Perfect hash redirect table
+  u4* _offsets_table;   // Location offset table
+  u1* _location_bytes;  // Location attributes
+  u1* _string_bytes;    // String table
+
+  // Compute number of bytes in image file index.
+  inline u8 index_size() {
+    return sizeof(ImageHeader) +
+    _header._location_count * sizeof(u4) * 2 +
+    _header._locations_size +
+    _header._strings_size;
+  }
+
+public:
+  ImageFile(const char* name);
+  ~ImageFile();
+
+  // Open image file for access.
+  bool open();
+  // Close image file.
+  void close();
+
+  // Retrieve name of image file.
+  inline const char* name() const {
+    return _name;
+  }
+
+  // Return a string table accessor.
+  inline const ImageStrings get_strings() const {
+    return ImageStrings(_string_bytes, _header._strings_size);
+  }
+
+  // Return number of locations in image file index.
+  inline u4 get_location_count() const {
+    return _header._location_count;
+  }
+
+  // Return location attribute stream for location i.
+  inline u1* get_location_data(u4 i) const {
+    u4 offset = _offsets_table[i];
+
+    return offset != 0 ? _location_bytes + offset : NULL;
+  }
+
+  // Return the attribute stream for a named resourced.
+  u1* find_location_data(const char* path) const;
+
+  // Verify that a found location matches the supplied path.
+  bool verify_location(ImageLocation& location, const char* path) const;
+
+  // Return the resource for the supplied location info.
+  u1* get_resource(ImageLocation& location) const;
+
+  // Return the resource associated with the path else NULL if not found.
+  void get_resource(const char* path, u1*& buffer, u8& size) const;
+
+  // Return an array of packages for a given module
+  GrowableArray<const char*>* packages(const char* name);
+};
+
+#endif // SHARE_VM_CLASSFILE_IMAGEFILE_HPP
--- a/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -110,7 +110,7 @@
 bool SharedPathsMiscInfo::check(jint type, const char* path) {
   switch (type) {
   case BOOT:
-    if (strcmp(path, Arguments::get_sysclasspath()) != 0) {
+    if (os::file_name_strcmp(path, Arguments::get_sysclasspath()) != 0) {
       return fail("[BOOT classpath mismatch, actual: -Dsun.boot.class.path=", Arguments::get_sysclasspath());
     }
     break;
--- a/hotspot/src/share/vm/memory/filemap.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -217,9 +217,14 @@
           EXCEPTION_MARK; // The following call should never throw, but would exit VM on error.
           SharedClassUtil::update_shared_classpath(cpe, ent, st.st_mtime, st.st_size, THREAD);
         } else {
-          ent->_filesize  = -1;
-          if (!os::dir_is_empty(name)) {
-            ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name);
+          struct stat st;
+          if ((os::stat(name, &st) == 0) && ((st.st_mode & S_IFDIR) == S_IFDIR)) {
+            if (!os::dir_is_empty(name)) {
+              ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name);
+            }
+            ent->_filesize = -1;
+          } else {
+            ent->_filesize = -2;
           }
         }
         ent->_name = strptr;
@@ -271,7 +276,7 @@
         fail_continue("directory is not empty: %s", name);
         ok = false;
       }
-    } else {
+    } else if (ent->is_jar()) {
       if (ent->_timestamp != st.st_mtime ||
           ent->_filesize != st.st_size) {
         ok = false;
--- a/hotspot/src/share/vm/memory/filemap.hpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/memory/filemap.hpp	Wed Jul 05 20:08:27 2017 +0200
@@ -44,8 +44,11 @@
 class SharedClassPathEntry VALUE_OBJ_CLASS_SPEC {
 public:
   const char *_name;
-  time_t _timestamp;          // jar timestamp,  0 if is directory
-  long   _filesize;           // jar file size, -1 if is directory
+  time_t _timestamp;          // jar timestamp,  0 if is directory or other
+  long   _filesize;           // jar file size, -1 if is directory, -2 if other
+  bool is_jar() {
+    return _timestamp != 0;
+  }
   bool is_dir() {
     return _filesize == -1;
   }
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -115,8 +115,6 @@
 vfprintf_hook_t  Arguments::_vfprintf_hook      = NULL;
 
 
-SystemProperty *Arguments::_java_ext_dirs = NULL;
-SystemProperty *Arguments::_java_endorsed_dirs = NULL;
 SystemProperty *Arguments::_sun_boot_library_path = NULL;
 SystemProperty *Arguments::_java_library_path = NULL;
 SystemProperty *Arguments::_java_home = NULL;
@@ -125,6 +123,7 @@
 
 char* Arguments::_meta_index_path = NULL;
 char* Arguments::_meta_index_dir = NULL;
+char* Arguments::_ext_dirs = NULL;
 
 // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string
 
@@ -184,8 +183,6 @@
   // Following are JVMTI agent writable properties.
   // Properties values are set to NULL and they are
   // os specific they are initialized in os::init_system_properties_values().
-  _java_ext_dirs = new SystemProperty("java.ext.dirs", NULL,  true);
-  _java_endorsed_dirs = new SystemProperty("java.endorsed.dirs", NULL,  true);
   _sun_boot_library_path = new SystemProperty("sun.boot.library.path", NULL,  true);
   _java_library_path = new SystemProperty("java.library.path", NULL,  true);
   _java_home =  new SystemProperty("java.home", NULL,  true);
@@ -194,8 +191,6 @@
   _java_class_path = new SystemProperty("java.class.path", "",  true);
 
   // Add to System Property list.
-  PropertyList_add(&_system_properties, _java_ext_dirs);
-  PropertyList_add(&_system_properties, _java_endorsed_dirs);
   PropertyList_add(&_system_properties, _sun_boot_library_path);
   PropertyList_add(&_system_properties, _java_library_path);
   PropertyList_add(&_system_properties, _java_home);
@@ -344,13 +339,9 @@
 // components, in order:
 //
 //     prefix           // from -Xbootclasspath/p:...
-//     endorsed         // the expansion of -Djava.endorsed.dirs=...
 //     base             // from os::get_system_properties() or -Xbootclasspath=
 //     suffix           // from -Xbootclasspath/a:...
 //
-// java.endorsed.dirs is a list of directories; any jar or zip files in the
-// directories are added to the sysclasspath just before the base.
-//
 // This could be AllStatic, but it isn't needed after argument processing is
 // complete.
 class SysClassPath: public StackObj {
@@ -364,16 +355,9 @@
   inline void add_suffix(const char* suffix);
   inline void reset_path(const char* base);
 
-  // Expand the jar/zip files in each directory listed by the java.endorsed.dirs
-  // property.  Must be called after all command-line arguments have been
-  // processed (in particular, -Djava.endorsed.dirs=...) and before calling
-  // combined_path().
-  void expand_endorsed();
-
   inline const char* get_base()     const { return _items[_scp_base]; }
   inline const char* get_prefix()   const { return _items[_scp_prefix]; }
   inline const char* get_suffix()   const { return _items[_scp_suffix]; }
-  inline const char* get_endorsed() const { return _items[_scp_endorsed]; }
 
   // Combine all the components into a single c-heap-allocated string; caller
   // must free the string if/when no longer needed.
@@ -390,20 +374,17 @@
   // base are allocated in the C heap and freed by this class.
   enum {
     _scp_prefix,        // from -Xbootclasspath/p:...
-    _scp_endorsed,      // the expansion of -Djava.endorsed.dirs=...
     _scp_base,          // the default sysclasspath
     _scp_suffix,        // from -Xbootclasspath/a:...
     _scp_nitems         // the number of items, must be last.
   };
 
   const char* _items[_scp_nitems];
-  DEBUG_ONLY(bool _expansion_done;)
 };
 
 SysClassPath::SysClassPath(const char* base) {
   memset(_items, 0, sizeof(_items));
   _items[_scp_base] = base;
-  DEBUG_ONLY(_expansion_done = false;)
 }
 
 SysClassPath::~SysClassPath() {
@@ -411,7 +392,6 @@
   for (int i = 0; i < _scp_nitems; ++i) {
     if (i != _scp_base) reset_item_at(i);
   }
-  DEBUG_ONLY(_expansion_done = false;)
 }
 
 inline void SysClassPath::set_base(const char* base) {
@@ -447,41 +427,11 @@
 
 //------------------------------------------------------------------------------
 
-void SysClassPath::expand_endorsed() {
-  assert(_items[_scp_endorsed] == NULL, "can only be called once.");
-
-  const char* path = Arguments::get_property("java.endorsed.dirs");
-  if (path == NULL) {
-    path = Arguments::get_endorsed_dir();
-    assert(path != NULL, "no default for java.endorsed.dirs");
-  }
-
-  char* expanded_path = NULL;
-  const char separator = *os::path_separator();
-  const char* const end = path + strlen(path);
-  while (path < end) {
-    const char* tmp_end = strchr(path, separator);
-    if (tmp_end == NULL) {
-      expanded_path = add_jars_to_path(expanded_path, path);
-      path = end;
-    } else {
-      char* dirpath = NEW_C_HEAP_ARRAY(char, tmp_end - path + 1, mtInternal);
-      memcpy(dirpath, path, tmp_end - path);
-      dirpath[tmp_end - path] = '\0';
-      expanded_path = add_jars_to_path(expanded_path, dirpath);
-      FREE_C_HEAP_ARRAY(char, dirpath, mtInternal);
-      path = tmp_end + 1;
-    }
-  }
-  _items[_scp_endorsed] = expanded_path;
-  DEBUG_ONLY(_expansion_done = true;)
-}
 
 // Combine the bootclasspath elements, some of which may be null, into a single
 // c-heap-allocated string.
 char* SysClassPath::combined_path() {
   assert(_items[_scp_base] != NULL, "empty default sysclasspath");
-  assert(_expansion_done, "must call expand_endorsed() first.");
 
   size_t lengths[_scp_nitems];
   size_t total_len = 0;
@@ -3084,6 +3034,20 @@
 #endif
     // -D
     } else if (match_option(option, "-D", &tail)) {
+      if (match_option(option, "-Djava.endorsed.dirs=", &tail)) {
+        // abort if -Djava.endorsed.dirs is set
+        jio_fprintf(defaultStream::output_stream(),
+          "-Djava.endorsed.dirs is not supported. Endorsed standards and standalone APIs\n"
+          "in modular form will be supported via the concept of upgradeable modules.\n");
+        return JNI_EINVAL;
+      }
+      if (match_option(option, "-Djava.ext.dirs=", &tail)) {
+        // abort if -Djava.ext.dirs is set
+        jio_fprintf(defaultStream::output_stream(),
+          "-Djava.ext.dirs is not supported.  Use -classpath instead.\n");
+        return JNI_EINVAL;
+      }
+
       if (!add_property(tail)) {
         return JNI_ENOMEM;
       }
@@ -3529,11 +3493,89 @@
   }
 }
 
+static bool has_jar_files(const char* directory) {
+  DIR* dir = os::opendir(directory);
+  if (dir == NULL) return false;
+
+  struct dirent *entry;
+  char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal);
+  bool hasJarFile = false;
+  while (!hasJarFile && (entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
+    const char* name = entry->d_name;
+    const char* ext = name + strlen(name) - 4;
+    hasJarFile = ext > name && (os::file_name_strcmp(ext, ".jar") == 0);
+  }
+  FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
+  os::closedir(dir);
+  return hasJarFile ;
+}
+
+static int check_non_empty_dirs(const char* path) {
+  const char separator = *os::path_separator();
+  const char* const end = path + strlen(path);
+  int nonEmptyDirs = 0;
+  while (path < end) {
+    const char* tmp_end = strchr(path, separator);
+    if (tmp_end == NULL) {
+      if (has_jar_files(path)) {
+        nonEmptyDirs++;
+        jio_fprintf(defaultStream::output_stream(),
+          "Non-empty directory: %s\n", path);
+      }
+      path = end;
+    } else {
+      char* dirpath = NEW_C_HEAP_ARRAY(char, tmp_end - path + 1, mtInternal);
+      memcpy(dirpath, path, tmp_end - path);
+      dirpath[tmp_end - path] = '\0';
+      if (has_jar_files(dirpath)) {
+        nonEmptyDirs++;
+        jio_fprintf(defaultStream::output_stream(),
+          "Non-empty directory: %s\n", dirpath);
+      }
+      FREE_C_HEAP_ARRAY(char, dirpath, mtInternal);
+      path = tmp_end + 1;
+    }
+  }
+  return nonEmptyDirs;
+}
+
 jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required) {
-  // This must be done after all -D arguments have been processed.
-  scp_p->expand_endorsed();
-
-  if (scp_assembly_required || scp_p->get_endorsed() != NULL) {
+  // check if the default lib/endorsed directory exists; if so, error
+  char path[JVM_MAXPATHLEN];
+  const char* fileSep = os::file_separator();
+  sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep);
+
+  if (CheckEndorsedAndExtDirs) {
+    int nonEmptyDirs = 0;
+    // check endorsed directory
+    nonEmptyDirs += check_non_empty_dirs(path);
+    // check the extension directories
+    nonEmptyDirs += check_non_empty_dirs(Arguments::get_ext_dirs());
+    if (nonEmptyDirs > 0) {
+      return JNI_ERR;
+    }
+  }
+
+  DIR* dir = os::opendir(path);
+  if (dir != NULL) {
+    jio_fprintf(defaultStream::output_stream(),
+      "<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and standalone APIs\n"
+      "in modular form will be supported via the concept of upgradeable modules.\n");
+    os::closedir(dir);
+    return JNI_ERR;
+  }
+
+  sprintf(path, "%s%slib%sext", Arguments::get_java_home(), fileSep, fileSep);
+  dir = os::opendir(path);
+  if (dir != NULL) {
+    jio_fprintf(defaultStream::output_stream(),
+      "<JAVA_HOME>/lib/ext exists, extensions mechanism no longer supported; "
+      "Use -classpath instead.\n.");
+    os::closedir(dir);
+    return JNI_ERR;
+  }
+
+  if (scp_assembly_required) {
     // Assemble the bootclasspath elements into the final path.
     Arguments::set_sysclasspath(scp_p->combined_path());
   }
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Wed Jul 05 20:08:27 2017 +0200
@@ -254,8 +254,6 @@
   static SystemProperty* _system_properties;
 
   // Quick accessor to System properties in the list:
-  static SystemProperty *_java_ext_dirs;
-  static SystemProperty *_java_endorsed_dirs;
   static SystemProperty *_sun_boot_library_path;
   static SystemProperty *_java_library_path;
   static SystemProperty *_java_home;
@@ -266,6 +264,10 @@
   static char* _meta_index_path;
   static char* _meta_index_dir;
 
+  // temporary: to emit warning if the default ext dirs are not empty.
+  // remove this variable when the warning is no longer needed.
+  static char* _ext_dirs;
+
   // java.vendor.url.bug, bug reporting URL for fatal errors.
   static const char* _java_vendor_url_bug;
 
@@ -586,8 +588,7 @@
   static void set_dll_dir(char *value) { _sun_boot_library_path->set_value(value); }
   static void set_java_home(char *value) { _java_home->set_value(value); }
   static void set_library_path(char *value) { _java_library_path->set_value(value); }
-  static void set_ext_dirs(char *value) { _java_ext_dirs->set_value(value); }
-  static void set_endorsed_dirs(char *value) { _java_endorsed_dirs->set_value(value); }
+  static void set_ext_dirs(char *value)     { _ext_dirs = os::strdup_check_oom(value); }
   static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); }
   static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); }
   static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) {
@@ -597,14 +598,14 @@
 
   static char* get_java_home() { return _java_home->value(); }
   static char* get_dll_dir() { return _sun_boot_library_path->value(); }
-  static char* get_endorsed_dir() { return _java_endorsed_dirs->value(); }
   static char* get_sysclasspath() { return _sun_boot_class_path->value(); }
   static char* get_meta_index_path() { return _meta_index_path; }
   static char* get_meta_index_dir()  { return _meta_index_dir;  }
-  static char* get_ext_dirs() { return _java_ext_dirs->value(); }
+  static char* get_ext_dirs()        { return _ext_dirs;  }
   static char* get_appclasspath() { return _java_class_path->value(); }
   static void  fix_appclasspath();
 
+
   // Operation modi
   static Mode mode()                { return _mode; }
   static bool is_interpreter_only() { return mode() == _int; }
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 05 20:08:27 2017 +0200
@@ -1233,6 +1233,9 @@
   product(bool, CheckJNICalls, false,                                       \
           "Verify all arguments to JNI calls")                              \
                                                                             \
+  product(bool, CheckEndorsedAndExtDirs, false,                             \
+          "Verify the endorsed and extension directories are not used")     \
+                                                                            \
   product(bool, UseFastJNIAccessors, true,                                  \
           "Use optimized versions of Get<Primitive>Field")                  \
                                                                             \
--- a/hotspot/src/share/vm/runtime/os.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/runtime/os.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -1230,11 +1230,21 @@
   Arguments::set_meta_index_path(meta_index, meta_index_dir);
 
   char* sysclasspath = NULL;
+  struct stat st;
+
+  // modular image if bootmodules.jimage exists
+  char* jimage = format_boot_path("%/lib/modules/bootmodules.jimage", home, home_len, fileSep, pathSep);
+  if (jimage == NULL) return false;
+  bool has_jimage = (os::stat(jimage, &st) == 0);
+  if (has_jimage) {
+    Arguments::set_sysclasspath(jimage);
+    return true;
+  }
+  FREE_C_HEAP_ARRAY(char, jimage, mtInternal);
 
   // images build if rt.jar exists
   char* rt_jar = format_boot_path("%/lib/rt.jar", home, home_len, fileSep, pathSep);
   if (rt_jar == NULL) return false;
-  struct stat st;
   bool has_rt_jar = (os::stat(rt_jar, &st) == 0);
   FREE_C_HEAP_ARRAY(char, rt_jar, mtInternal);
 
--- a/hotspot/src/share/vm/runtime/os.hpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/runtime/os.hpp	Wed Jul 05 20:08:27 2017 +0200
@@ -500,6 +500,7 @@
   //File i/o operations
 
   static size_t read(int fd, void *buf, unsigned int nBytes);
+  static size_t read_at(int fd, void *buf, unsigned int nBytes, jlong offset);
   static size_t restartable_read(int fd, void *buf, unsigned int nBytes);
   static size_t write(int fd, const void *buf, unsigned int nBytes);
 
--- a/hotspot/src/share/vm/runtime/statSampler.cpp	Wed Dec 03 14:26:07 2014 +0000
+++ b/hotspot/src/share/vm/runtime/statSampler.cpp	Wed Jul 05 20:08:27 2017 +0200
@@ -225,8 +225,6 @@
   "java.vm.info",
   "java.library.path",
   "java.class.path",
-  "java.endorsed.dirs",
-  "java.ext.dirs",
   "java.version",
   "java.home",
   NULL
--- a/jdk/.hgtags	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/.hgtags	Wed Jul 05 20:08:27 2017 +0200
@@ -282,3 +282,4 @@
 27c3345d6dce39a22c262f30bb1f0e0b00c3709e jdk9-b37
 d2d745313c81d1fc01f426983b9f784ab1f750e8 jdk9-b38
 ca6edf957fe1c6ea818530b503578e872cea7239 jdk9-b39
+f1ed1540da70a066527fd043413107e47721edbf jdk9-b40
--- a/jdk/make/Bundles.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-#
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-include $(SPEC)
-include MakeBase.gmk
-
-default: bundles
-
-# Only macosx has bundles defined.
-ifeq ($(OPENJDK_TARGET_OS), macosx)
-
-  bundles: jre-bundle jdk-bundle
-
-  # JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
-
-  MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle
-
-  # All these OPENJDK checks are needed since there is no coherency between
-  # these values in open and closed. Should probably be fixed.
-  ifndef OPENJDK
-    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
-  else
-    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE)
-  endif
-  BUNDLE_ID_JRE := $(BUNDLE_ID).jre
-  BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
-
-  BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
-  BUNDLE_NAME_JRE := $(BUNDLE_NAME)
-  BUNDLE_NAME_JDK := $(BUNDLE_NAME)
-
-  ifndef OPENJDK
-    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
-  else
-    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION))
-  endif
-  BUNDLE_INFO_JRE := $(BUNDLE_INFO)
-  BUNDLE_INFO_JDK := $(BUNDLE_INFO)
-
-  BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
-  BUNDLE_VERSION := $(JDK_VERSION)
-  ifeq ($(COMPANY_NAME), N/A)
-    BUNDLE_VENDOR := UNDEFINED
-  else
-    BUNDLE_VENDOR := $(COMPANY_NAME)
-  endif
-
-
-  JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
-  JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
-
-  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
-  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
-
-  # Copy empty directories (jre/lib/applet).
-  $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
-	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
-
-  $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
-	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
-
-  $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
-	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(LN) -s ../Home/jre/lib/jli/libjli.dylib $@
-
-  $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
-	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(LN) -s ../Home/lib/jli/libjli.dylib $@
-
-  $(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
-	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
-	    -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
-	    -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
-	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
-	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
-	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
-	    < $(MACOSX_PLIST_SRC)/JDK-Info.plist > $@
-
-  $(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
-	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
-	    -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
-	    -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
-	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
-	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
-	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
-	    < $(MACOSX_PLIST_SRC)/JRE-Info.plist > $@
-
-  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
-      $(JDK_BUNDLE_DIR)/Info.plist
-	$(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR))
-
-  jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
-      $(JRE_BUNDLE_DIR)/Info.plist
-	$(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR))
-
-else # Not macosx
-
-  bundles:
-	$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
-
-endif # macosx
-
-.PHONY: jdk-bundle jre-bundle bundles
--- a/jdk/make/CompileDemos.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/CompileDemos.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -53,7 +53,7 @@
   $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
       SETUP := GENERATE_USINGJDKBYTECODE, \
       SRC := $(JDK_TOPDIR)/src/$3demo/share/applets/$1, \
-      BIN := $(JDK_OUTPUTDIR)/demo/applets/$1, \
+      BIN := $(SUPPORT_OUTPUTDIR)/demo/image/applets/$1, \
       COPY := .html .java .xyz .obj .au .gif, \
       DISABLE_SJAVAC := $2))
       BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
@@ -118,27 +118,27 @@
         SETUP := GENERATE_USINGJDKBYTECODE, \
         ADD_JAVAC_FLAGS := $3, \
         SRC := $$($1_MAIN_SRC) $5, \
-        BIN := $(JDK_OUTPUTDIR)/democlasses/$2/$1, \
+        BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/$2/$1, \
         COPY := $(PATTERNS_TO_COPY) $(10), \
-        JAR := $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE), \
+        JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \
         JARMAIN := $4, \
         MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
         EXTRA_MANIFEST_ATTR := $(11), \
-        SRCZIP := $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip, \
+        SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \
         EXCLUDE_FILES := $9, \
         DISABLE_SJAVAC := $(12)))
 
     BUILD_DEMOS += $$(BUILD_DEMO_$1) \
-        $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE) \
-        $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip
+        $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE) \
+        $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip
   endif
 
   # Copy files.
   $1_COPY_TARGETS := $$(patsubst $$($1_SRC_BASE)/%, \
-      $(JDK_OUTPUTDIR)/demo/$2/$1/%, \
+      $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%, \
       $$(wildcard $$(addprefix $$($1_SRC_BASE)/, $7)))
   ifneq ($7, )
-    $(JDK_OUTPUTDIR)/demo/$2/$1/%: $$($1_SRC_BASE)/%
+    $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%: $$($1_SRC_BASE)/%
 	$$(call install-file)
 	$(CHMOD) -f ug+w $$@
 
@@ -148,20 +148,20 @@
 endef
 
 $(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
-$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services: \
-    $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar \
+$(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services: \
+    $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar \
     $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
-	(cd $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM && \
+	(cd $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM && \
 	$(MKDIR) -p _the.tmp/META-INF/services && \
 	$(CP) $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
 	cd ./_the.tmp && \
-	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
+	$(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
 	cd ./META-INF/services && \
-	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
-	$(RM) -r $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.tmp
+	$(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
+	$(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.tmp
 	$(TOUCH) $@
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
+BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services
 
 ifneq ($(OPENJDK_TARGET_OS), solaris)
   $(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
@@ -192,10 +192,10 @@
       SplashScreen-Image: resources/images/splash.png,true))
 
   BUILD_DEMOS += $(patsubst $(DEMO_CLOSED_SHARE_SRC)/nbproject/%, \
-      $(JDK_OUTPUTDIR)/demo/nbproject/%, \
+      $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
       $(call CacheFind, $(DEMO_CLOSED_SHARE_SRC)/nbproject))
 
-  $(JDK_OUTPUTDIR)/demo/nbproject/%: $(DEMO_CLOSED_SHARE_SRC)/nbproject/%
+  $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_CLOSED_SHARE_SRC)/nbproject/%
 	$(call install-file)
 	$(CHMOD) -f ug+w $@
 endif
@@ -266,16 +266,16 @@
           -D "JDK_FNAME=$1.dll" \
           -D "JDK_INTERNAL_NAME=$1" \
           -D "JDK_FTYPE=0x2L", \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1, \
-      OUTPUT_DIR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1, \
+      OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib, \
       LIBRARY := $1))
 
   $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
       SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
       EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
-      ZIP := $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
+      ZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip))
 
-  $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
+  $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
 	$$(call install-file)
 	$(CHMOD) -f ug+w $$@
 
@@ -283,30 +283,30 @@
     $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
         SETUP := GENERATE_USINGJDKBYTECODE, \
         SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
-        BIN := $(JDK_OUTPUTDIR)/democlasses/jvmti/$1, \
+        BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jvmti/$1, \
         COPY := $(PATTERNS_TO_COPY), \
-        JAR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar, \
+        JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \
         EXTRA_MANIFEST_ATTR := Main-Class: \n, \
         MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
 
-    BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar
+    BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar
   endif
 
   BUILD_DEMOS += $$(BUILD_DEMO_JVMTI_$1) \
-      $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip \
-      $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt
+      $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip \
+      $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt
 
   ifeq ($(OPENJDK_TARGET_OS), windows)
     # These files normally end up in OBJECT_DIR but for demos they
     # are supposed to be included in the distro.
-    $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
-	$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.lib $$@
+    $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
+	$(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.lib $$@
 
-    $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
-	$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.exp $$@
+    $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
+	$(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.exp $$@
 
-    BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib \
-        $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp
+    BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib \
+        $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp
   endif
 endef
 
@@ -321,95 +321,97 @@
 
 ##################################################################################################
 
-$(JDK_OUTPUTDIR)/demo/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
+$(SUPPORT_OUTPUTDIR)/demo/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
 	$(call install-file)
 	$(CHMOD) -f ug+w $@
 
-$(JDK_OUTPUTDIR)/demo/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
+$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
 	$(call install-file)
 	$(CHMOD) -f ug+w $@
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
-    $(JDK_OUTPUTDIR)/demo/jvmti/index.html
+BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/management/index.html \
+    $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html
 
 ##################################################################################################
 
 # The netbeans project files are copied into the demo directory.
 ifeq ($(OPENJDK_TARGET_OS), solaris)
   BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
-    $(JDK_OUTPUTDIR)/demo/nbproject/%, \
+    $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
     $(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \
     $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)))
 else
   BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
-    $(JDK_OUTPUTDIR)/demo/nbproject/%, \
+    $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
     $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
 endif
 
-$(JDK_OUTPUTDIR)/demo/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
+$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
 	$(call install-file)
 	$(CHMOD) -f ug+w $@
 
 ##################################################################################################
 
-$(JDK_OUTPUTDIR)/demo/README: $(DEMO_SHARE_SRC)/README
+$(SUPPORT_OUTPUTDIR)/demo/image/README: $(DEMO_SHARE_SRC)/README
 	$(call install-file)
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
+BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/README
 
 ##################################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), solaris)
 
-  $(JDK_OUTPUTDIR)/democlasses/jni/Poller/%: $(DEMO_SOLARIS_SRC)/jni/Poller/%
+  $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/%: $(DEMO_SOLARIS_SRC)/jni/Poller/%
 	$(call install-file)
 	$(CHMOD) -f ug+w $@
 
-  $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt: $(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
+  $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt: $(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
 	$(call install-file)
 	$(CHMOD) -f ug+w $@
 
-  $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar: \
-      $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
+  $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar: \
+      $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/README.txt \
+      $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/Poller.c
 
   $(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
       SETUP := GENERATE_USINGJDKBYTECODE, \
       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
-      BIN := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
-      HEADERS := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
-      JAR := $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar, \
+      BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
+      HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
+      JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \
       MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
-      SRCZIP := $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip, \
+      SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \
       COPY := README.txt Poller.c, \
       JARMAIN := Client))
 
 
 
-  BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip \
-      $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt
+  BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar \
+      $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip \
+      $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt
 
   $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
       LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
-          -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
+          -I$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LDFLAGS_SUFFIX_solaris := -lc, \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jni/Poller, \
-      OUTPUT_DIR := $(JDK_OUTPUTDIR)/demoobjs, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller, \
+      OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native, \
       LIBRARY := Poller))
 
   #
   # We can only compile native code after jar has been build (since we depend on generated .h files)
   #
-  $(JDK_OUTPUTDIR)/demoobjs/jni/Poller/Poller.o: $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar
+  $(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller/Poller.o: $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar
 
-  $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX): \
-      $(JDK_OUTPUTDIR)/demoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
+  $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX): \
+      $(SUPPORT_OUTPUTDIR)/demo/native/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
 	$(call install-file)
 
-  BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
+  BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
 
 endif
 
@@ -419,22 +421,22 @@
   DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db)
   DB_DEMO_ZIPFILE := $(wildcard $(DB_ZIP_DIR)/*.zip)
 
-  $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
+  $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
 	$(MKDIR) -p $(@D)
-	$(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo
-	$(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $<
-	$(MV) $(JDK_OUTPUTDIR)/demo/db-derby-*-bin/demo $(JDK_OUTPUTDIR)/demo/db
-	$(CD) $(JDK_OUTPUTDIR)/demo && $(RM) -r db-derby-*-bin
+	$(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/db $(SUPPORT_OUTPUTDIR)/demo/image/demo
+	$(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(UNZIP) -q -o $<
+	$(MV) $(SUPPORT_OUTPUTDIR)/demo/image/db-derby-*-bin/demo $(SUPPORT_OUTPUTDIR)/demo/image/db
+	$(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(RM) -r db-derby-*-bin
 	$(TOUCH) $@
 
   # Copy this after the unzip above to avoid race with directory creation and mv command.
-  $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
+  $(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html: \
       $(DB_ZIP_DIR)/README-JDK-DEMOS.html \
-      | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
+      | $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped
 	$(MKDIR) -p $(@D)
 	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@
 
-  BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
+  BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped $(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html
 endif
 
 ##################################################################################################
--- a/jdk/make/CompileInterimRmic.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/CompileInterimRmic.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
     SETUP := GENERATE_OLDBYTECODE, \
     SRC := $(JDK_TOPDIR)/src/jdk.rmic/share/classes, \
     INCLUDES := $(RMIC_PKGS), \
-    BIN := $(JDK_OUTPUTDIR)/interim_rmic_classes, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_classes, \
     COPY := .properties, \
     JAVAC_SOURCE_PATH_OVERRIDE := $(addprefix $(JDK_TOPDIR)/src/jdk.rmic/share/classes/, $(RMIC_PKGS))))
 
--- a/jdk/make/CopySamples.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/CopySamples.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 include $(SPEC)
 include MakeBase.gmk
 
-SAMPLE_TARGET_DIR := $(JDK_OUTPUTDIR)/sample
+SAMPLE_TARGET_DIR := $(SUPPORT_OUTPUTDIR)/sample
 SAMPLE_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/share
 SAMPLE_CLOSED_SOURCE_DIR := $(JDK_TOPDIR)/src/closed/sample/share
 SAMPLE_SOLARIS_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/solaris
--- a/jdk/make/CreateJars.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,795 +0,0 @@
-#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-
-default: all
-
-include Tools.gmk
-
-JDK_OUT_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*)
-$(eval $(call FillCacheFind, $(JDK_OUT_CLASSES)))
-
-include Profiles.gmk
-
-#
-# This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
-#
-MAKEFILE = $(JDK_TOPDIR)/make/CreateJars.gmk
-#
-# And similarly for the Profiles
-PROFILE_MAKEFILES = $(JDK_TOPDIR)/make/Profiles.gmk $(JDK_TOPDIR)/make/profile-rtjar-includes.txt
-
-MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
-BEANMANIFEST := $(JDK_TOPDIR)/make/data/swingbeaninfo/manifest.mf
-
-$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/lib))
-
-##########################################################################################
-
-$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR, , \
-    SRCS := $(JDK_OUTPUTDIR)/modules/jdk.jconsole, \
-    SUFFIXES := .class .gif .png .properties, \
-    INCLUDES := sun/tools/jconsole com/sun/tools/jconsole, \
-    JARMAIN := sun.tools.jconsole.JConsole, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/jconsole.jar, \
-    SKIP_METAINF := true))
-
-
-##########################################################################################
-
-$(eval $(call SetupArchive,BUILD_DNS_JAR, , \
-    SRCS := $(JDK_OUTPUTDIR)/modules/jdk.naming.dns, \
-    INCLUDES := sun/net/spi/nameservice/dns, \
-    EXTRA_FILES := META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar, \
-    SKIP_METAINF := true))
-
-
-##########################################################################################
-
-LOCALEDATA_INCLUDE_LOCALES := ar be bg ca cs da de el es et fi fr ga hi hr hu in is it \
-    iw ja ko lt lv mk ms mt nl no pl pt ro ru sk sl sq sr sv \
-    th tr uk vi zh
-
-LOCALEDATA_INCLUDES := sun/util/resources/provider/NonEnLocaleDataMetaInfo.class
-LOCALEDATA_INCLUDES += $(addprefix sun/text/resources/, $(LOCALEDATA_INCLUDE_LOCALES)) \
-    $(addprefix sun/util/resources/, $(LOCALEDATA_INCLUDE_LOCALES))
-
-LOCALEDATA_SERVICES_DIR := $(IMAGES_OUTPUTDIR)/localemetainfo
-
-LOCALEDATA_METAINF_SERVICES := $(LOCALEDATA_SERVICES_DIR)/META-INF/services/sun.util.locale.provider.LocaleDataMetaInfo
-
-$(LOCALEDATA_METAINF_SERVICES): $(JDK_TOPDIR)/src/jdk.localedata/META-INF/localedata-services/sun.util.locale.provider.LocaleDataMetaInfo
-	$(install-file)
-
-$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR, \
-    $(LOCALEDATA_METAINF_SERVICES), \
-    SRCS := $(JDK_OUTPUTDIR)/modules/jdk.localedata \
-        $(LOCALEDATA_SERVICES_DIR), \
-    SUFFIXES := .class _dict _th, \
-    INCLUDES := $(LOCALEDATA_INCLUDES), \
-    EXTRA_FILES := META-INF/services/sun.util.locale.provider.LocaleDataMetaInfo, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar, \
-    SKIP_METAINF := true))
-
-##########################################################################################
-#
-# Different variants of rt.jar are built based on the current profile. The output
-# directory is augmented with the profile name so that the final jar file and all the
-# intermediary list files will be in directory. This has the form lib$PROFILE rather than
-# lib/$PROFILE so that it won't get copied as part of the image generation process.
-# Each profile customizes the RT_JAR_EXCLUDES variable.
-#
-##########################################################################################
-
-# Full JRE exclude list for rt.jar and resources.jar
-# This value should exclude types destined for jars other than rt.jar and resources.jar.
-# When building a Profile this value augments the profile specific exclusions
-RT_JAR_EXCLUDES += \
-    com/oracle/security/ucrypto \
-    com/sun/codemodel \
-    com/sun/crypto/provider \
-    com/sun/istack/internal/tools \
-    com/sun/jarsigner \
-    com/sun/java/accessibility \
-    com/sun/javadoc \
-    com/sun/jdi \
-    com/sun/net/ssl/internal/ssl \
-    com/sun/source \
-    com/sun/tools \
-    com/sun/xml/internal/dtdparser \
-    com/sun/xml/internal/rngom \
-    com/sun/xml/internal/xsom \
-    javax/crypto \
-    javax/swing/AbstractButtonBeanInfo.class \
-    javax/swing/beaninfo \
-    javax/swing/BoxBeanInfo.class \
-    javax/swing/JAppletBeanInfo.class \
-    javax/swing/JButtonBeanInfo.class \
-    javax/swing/JCheckBoxBeanInfo.class \
-    javax/swing/JCheckBoxMenuItemBeanInfo.class \
-    javax/swing/JColorChooserBeanInfo.class \
-    javax/swing/JComboBoxBeanInfo.class \
-    javax/swing/JComponentBeanInfo.class \
-    javax/swing/JDesktopPaneBeanInfo.class \
-    javax/swing/JDialogBeanInfo.class \
-    javax/swing/JEditorPaneBeanInfo.class \
-    javax/swing/JFileChooserBeanInfo.class \
-    javax/swing/JFormattedTextFieldBeanInfo.class \
-    javax/swing/JFrameBeanInfo.class \
-    javax/swing/JInternalFrameBeanInfo.class \
-    javax/swing/JLabelBeanInfo.class \
-    javax/swing/JLayeredPaneBeanInfo.class \
-    javax/swing/JListBeanInfo.class \
-    javax/swing/JMenuBarBeanInfo.class \
-    javax/swing/JMenuBeanInfo.class \
-    javax/swing/JMenuItemBeanInfo.class \
-    javax/swing/JOptionPaneBeanInfo.class \
-    javax/swing/JPanelBeanInfo.class \
-    javax/swing/JPasswordFieldBeanInfo.class \
-    javax/swing/JPopupMenuBeanInfo.class \
-    javax/swing/JProgressBarBeanInfo.class \
-    javax/swing/JRadioButtonBeanInfo.class \
-    javax/swing/JRadioButtonMenuItemBeanInfo.class \
-    javax/swing/JScrollBarBeanInfo.class \
-    javax/swing/JScrollPaneBeanInfo.class \
-    javax/swing/JSeparatorBeanInfo.class \
-    javax/swing/JSliderBeanInfo.class \
-    javax/swing/JSpinnerBeanInfo.class \
-    javax/swing/JSplitPaneBeanInfo.class \
-    javax/swing/JTabbedPaneBeanInfo.class \
-    javax/swing/JTableBeanInfo.class \
-    javax/swing/JTextAreaBeanInfo.class \
-    javax/swing/JTextFieldBeanInfo.class \
-    javax/swing/JTextPaneBeanInfo.class \
-    javax/swing/JToggleButtonBeanInfo.class \
-    javax/swing/JToolBarBeanInfo.class \
-    javax/swing/JTreeBeanInfo.class \
-    javax/swing/JWindowBeanInfo.class \
-    javax/swing/SwingBeanInfoBase.class \
-    javax/swing/text/JTextComponentBeanInfo.class \
-    jdk/nio/zipfs \
-    META-INF/services/com.sun.jdi.connect.Connector \
-    META-INF/services/com.sun.jdi.connect.spi.TransportService \
-    META-INF/services/com.sun.tools.attach.spi.AttachProvider \
-    META-INF/services/com.sun.tools.xjc.Plugin \
-    META-INF/services/javax.script.ScriptEngineFactory \
-    META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
-    META-INF/services/java.nio.file.spi.FileSystemProvider \
-    org/relaxng/datatype \
-    sun/awt/HKSCS.class \
-    sun/awt/motif/X11GB2312.class \
-    sun/awt/motif/X11GB2312$$$$Decoder.class \
-    sun/awt/motif/X11GB2312$$$$Encoder.class \
-    sun/awt/motif/X11GBK.class \
-    sun/awt/motif/X11GBK$$$$Encoder.class \
-    sun/awt/motif/X11KSC5601.class \
-    sun/awt/motif/X11KSC5601$$$$Decoder.class \
-    sun/awt/motif/X11KSC5601$$$$Encoder.class \
-    sun/jvmstat \
-    sun/net/spi/nameservice/dns \
-    sun/nio/cs/ext \
-    sun/rmi/rmic \
-    sun/security/ec \
-    sun/security/internal \
-    sun/security/mscapi \
-    sun/security/pkcs11 \
-    sun/security/provider/Sun.class \
-    sun/security/rsa/SunRsaSign.class \
-    sun/security/ssl \
-    sun/security/tools/jarsigner \
-    sun/swing/BeanInfoUtils.class \
-    sun/text/resources/cldr \
-    sun/tools/asm \
-    sun/tools/attach \
-    sun/tools/java \
-    sun/tools/javac \
-    sun/tools/jcmd \
-    sun/tools/jconsole \
-    sun/tools/jinfo \
-    sun/tools/jmap \
-    sun/tools/jps \
-    sun/tools/jstack \
-    sun/tools/jstat \
-    sun/tools/jstatd \
-    sun/tools/native2ascii \
-    sun/tools/serialver \
-    sun/tools/tree \
-    sun/tools/util \
-    sun/util/resources/provider/NonEnLocaleDataMetaInfo.class \
-    META-INF/services/sun.util.locale.provider.LocaleDataMetaInfo \
-    sun/util/resources/cldr \
-    $(LOCALEDATA_INCLUDES) \
-    com/oracle/jrockit/jfr \
-    oracle/jrockit/jfr \
-    jdk/jfr \
-    jdk/internal/dynalink \
-    jdk/nashorn \
-    sun/jvm \
-    toolbarButtonGraphics \
-    sa.properties \
-    com/sun/java/swing/action \
-    com/sun/java/swing/ui \
-    com/oracle/security \
-    #
-
-# Find all files in the classes dir to use as dependencies. This could be more fine granular.
-ALL_FILES_IN_CLASSES := $(call not-containing, _the., $(filter-out %javac_state, \
-    $(call CacheFind, $(JDK_OUT_CLASSES))))
-
-RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar_manifest
-RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar_manifest
-
-$(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
-	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
-	    $(MAINMANIFEST) >> $@.tmp
-	$(ECHO) >> $@.tmp
-	$(CAT) $(BEANMANIFEST) >> $@.tmp
-	$(MV) $@.tmp $@
-
-$(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
-	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
-	    $(MAINMANIFEST) >> $@.tmp
-	$(MV) $@.tmp $@
-
-$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude: $(MAKEFILE) $(PROFILE_MAKEFILES)
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp)
-	$(MV) $@.tmp $@
-
-$(IMAGES_OUTPUTDIR)/lib/classlist: $(JDK_TOPDIR)/make/data/classlist/classlist.$(OPENJDK_TARGET_OS) \
-    $(MAKEFILE)
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(TOOL_ADDJSUM) $< $@.tmp
-	$(MV) $@.tmp $@
-
-$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents: $(BUILD_TOOLS_JDK) $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude \
-    $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	($(CD) $(JDK_OUTPUTDIR)/modules && \
-	$(TOOL_JARREORDER) -m \
-	    -o $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude . )
-	$(MV) $@.tmp $@
-
-$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
-        ifneq ($(PROFILE), )
-          # Add back classes from excluded packages (fixing the $ substitution in the process)
-          # This currently won't work with modular build layout, but there currently are no 
-          # types needing to be re added.
-	  for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
-	    $(ECHO) $$type >> $@.tmp ; \
-	  done
-        endif
-	$(MV) $@.tmp $@
-
-$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(GREP) -v -e '\.class$$' \
-	    -e '/_the\.' -e '^_the\.' -e '\\_the\.' -e ' _the\.' -e 'javac_state' \
-	    $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
-        ifneq ($(PROFILE), )
-          # Strip out all META-INF/services/ entries
-	  $(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
-          # Add back the required services
-          # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
-          # we get a syntax error from sh. That doesn't happen on linux
-          # Preserve any -C <dir> part of the original include line.
-	  for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
-	    $(GREP) -e "$$service" $@.tmp >> $@.tmp2; \
-	  done
-	  $(MV) $@.tmp2 $@.tmp
-        endif
-	$(MV) $@.tmp $@
-
-# This is a hack but I don't know how to make this fit into the existing scheme
-$(PROFILE_VERSION_CLASS_TARGETS): $(PROFILE_VERSION_JAVA_TARGETS)
-	@$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE)
-
-
-RT_JAR_CREATE_OPTIONS := c0fm
-RT_JAR_UPDATE_OPTIONS := u0f
-ifeq ($(COMPRESS_JARS), true)
-  RT_JAR_CREATE_OPTIONS := cfm
-  RT_JAR_UPDATE_OPTIONS := uf
-endif
-
-# This defines a target-specific variables to make the shell logic easier to see.
-# We need to find the Version.class file for the profile currently being built
-$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \
-    CLASS_FILE = $(if $(PROFILE), $(strip $(foreach class, $(PROFILE_VERSION_CLASS_TARGETS), $(if $(findstring $(PROFILE), $(class)), $(class)))), NO_SUCH_FILE)
-# This is the real target
-$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS)
-	$(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS)
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(CD) $(JDK_OUTPUTDIR)/modules && \
-	$(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
-	    @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents && \
-	if [ -f $(CLASS_FILE) ]; then \
-	  $(ECHO) Updating rt.jar $(PROFILE) && \
-	  $(CD) $(patsubst %$(VERSION_CLASS_PATH), %, $(CLASS_FILE)) && \
-	  $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
-	fi
-	$(MV) $@.tmp $@
-
-$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/resources.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents \
-    $(RESOURCE_JAR_MANIFEST_FILE)
-	$(ECHO) Creating resources.jar
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(CD) $(JDK_OUTPUTDIR)/modules && \
-	$(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
-	    @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents
-	$(MV) $@.tmp $@
-
-##########################################################################################
-
-ifneq ($(OPENJDK_TARGET_OS), windows)
-  CHARSETS_EXTRA_FILES := sun/awt/motif/X11GBK.class \
-      sun/awt/motif/X11GB2312$$$$Decoder.class \
-      sun/awt/motif/X11GB2312.class \
-      sun/awt/motif/X11KSC5601$$$$Decoder.class \
-      sun/awt/motif/X11KSC5601$$$$Encoder.class \
-      sun/awt/motif/X11GB2312$$$$Encoder.class \
-      sun/awt/motif/X11GBK$$$$Encoder.class \
-      sun/awt/motif/X11KSC5601.class
-endif
-
-$(eval $(call SetupArchive,BUILD_CHARSETS_JAR, , \
-    SRCS := $(JDK_OUT_CLASSES), \
-    SUFFIXES := .class .dat, \
-    INCLUDES := sun/nio/cs/ext, \
-    EXTRA_FILES := sun/awt/HKSCS.class \
-        $(CHARSETS_EXTRA_FILES), \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
-    SKIP_METAINF := true, \
-    CHECK_COMPRESS_JAR := true))
-
-##########################################################################################
-
-$(eval $(call SetupArchive,BUILD_ZIPFS_JAR, , \
-    SRCS := $(JDK_OUT_CLASSES), \
-    INCLUDES := jdk/nio/zipfs, \
-    EXTRA_FILES := META-INF/services/java.nio.file.spi.FileSystemProvider, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar, \
-    SKIP_METAINF := true, \
-    CHECK_COMPRESS_JAR := true))
-
-##########################################################################################
-
-ifndef OPENJDK
-  ifeq ($(ENABLE_JFR), true)
-    $(eval $(call SetupArchive,BUILD_JFR_JAR, , \
-        SRCS := $(JDK_OUTPUTDIR)/modules/jdk.jfr, \
-        SUFFIXES := .class .jfc .xsd, \
-        INCLUDES := com/oracle/jrockit/jfr \
-            oracle/jrockit/jfr \
-            jdk/jfr, \
-        JAR := $(IMAGES_OUTPUTDIR)/lib/jfr.jar, \
-        SKIP_METAINF := true, \
-        MANIFEST := $(MAINMANIFEST), \
-        CHECK_COMPRESS_JAR := true))
-
-  endif
-endif
-
-##########################################################################################
-
-$(eval $(call SetupArchive,BUILD_JSSE_JAR, , \
-    SRCS := $(JDK_OUT_CLASSES), \
-    INCLUDES := sun/security/provider/Sun.class \
-        sun/security/rsa/SunRsaSign.class \
-        sun/security/ssl \
-        com/sun/net/ssl/internal/ssl, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/jsse.jar, \
-    SKIP_METAINF := true, \
-    MANIFEST := $(MAINMANIFEST), \
-    CHECK_COMPRESS_JAR := true))
-
-##########################################################################################
-
-$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR, , \
-    SRCS := $(JDK_OUTPUTDIR)/modules/java.desktop, \
-    SUFFIXES := BeanInfo.class .gif, \
-    INCLUDES := javax/swing sun/swing, \
-    EXCLUDES := javax/swing/plaf, \
-    EXTRA_FILES := javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/dt.jar, \
-    SKIP_METAINF := true))
-
-##########################################################################################
-
-# Get the CLDRVERSION
-include gensrc/GensrcCLDR.gmk
-
-CLDRDATA_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/cldrdata.jar
-
-CLDR_SERVICES_DIR := $(IMAGES_OUTPUTDIR)/cldrmetainfo
-
-CLDR_METAINF_SERVICES := $(CLDR_SERVICES_DIR)/META-INF/services/sun.util.locale.provider.LocaleDataMetaInfo
-
-$(CLDR_METAINF_SERVICES): $(JDK_TOPDIR)/src/jdk.localedata/META-INF/cldrdata-services/sun.util.locale.provider.LocaleDataMetaInfo
-	$(install-file)
-
-$(eval $(call SetupArchive,BUILD_CLDRDATA_JAR, \
-    $(CLDR_METAINF_SERVICES), \
-    SRCS := $(JDK_OUTPUTDIR)/modules/jdk.localedata \
-        $(CLDR_SERVICES_DIR), \
-    SUFFIXES := .class, \
-    INCLUDES := sun/text/resources/cldr \
-        sun/util/resources/cldr, \
-    EXTRA_FILES := META-INF/services/sun.util.locale.provider.LocaleDataMetaInfo, \
-    JAR := $(CLDRDATA_JAR_DST), \
-    EXTRA_MANIFEST_ATTR := CLDR-Version: $(CLDRVERSION), \
-    SKIP_METAINF := true))
-
-##########################################################################################
-
-TOOLS_JAR_INCLUDES := \
-    com/sun/codemodel \
-    com/sun/istack/internal/tools \
-    com/sun/jarsigner \
-    com/sun/javadoc \
-    com/sun/jdi \
-    com/sun/source \
-    com/sun/tools/attach \
-    com/sun/tools/classfile \
-    com/sun/tools/corba \
-    com/sun/tools/doclets \
-    com/sun/tools/doclint \
-    com/sun/tools/example/debug/expr \
-    com/sun/tools/example/debug/tty \
-    com/sun/tools/hat \
-    com/sun/tools/internal/jxc \
-    com/sun/tools/internal/jxc/ap \
-    com/sun/tools/internal/ws \
-    com/sun/tools/internal/ws/wscompile/plugin/at_generated \
-    com/sun/tools/internal/xjc \
-    com/sun/tools/javac \
-    com/sun/tools/javadoc \
-    com/sun/tools/javah \
-    com/sun/tools/javap \
-    com/sun/tools/jdeps \
-    com/sun/tools/jdi \
-    com/sun/tools/script/shell \
-    com/sun/xml/internal/dtdparser \
-    com/sun/xml/internal/rngom \
-    com/sun/xml/internal/xsom \
-    org/relaxng/datatype \
-    sun/applet \
-    sun/jvmstat \
-    sun/rmi/rmic \
-    sun/security/tools/jarsigner \
-    sun/tools/asm \
-    sun/tools/attach \
-    sun/tools/jar \
-    sun/tools/java \
-    sun/tools/javac \
-    sun/tools/jcmd \
-    sun/tools/jinfo \
-    sun/tools/jmap \
-    sun/tools/jps \
-    sun/tools/jstack \
-    sun/tools/jstat \
-    sun/tools/jstatd \
-    sun/tools/native2ascii \
-    sun/tools/serialver \
-    sun/tools/tree \
-    sun/tools/util
-
-# The sjavac tools is not ready for public consumption.
-TOOLS_JAR_EXCLUDES = com/sun/tools/sjavac
-
-TOOLS_JAR_SRC := $(addprefix $(JDK_OUTPUTDIR)/modules/,\
-    java.corba \
-    java.desktop \
-    jdk.attach \
-    jdk.compiler \
-    jdk.dev \
-    jdk.javadoc \
-    jdk.jconsole \
-    jdk.jcmd \
-    jdk.jdi \
-    jdk.jvmstat \
-    jdk.rmic \
-    jdk.runtime \
-    jdk.xml.bind \
-    jdk.xml.ws \
-    )
-    #
-
-$(eval $(call SetupArchive,BUILD_TOOLS_JAR, , \
-    SRCS := $(TOOLS_JAR_SRC), \
-    SUFFIXES := .class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
-        Tool aliasmap options, \
-    INCLUDES := $(TOOLS_JAR_INCLUDES), \
-    EXCLUDES := $(TOOLS_JAR_EXCLUDES), \
-    EXTRA_FILES := \
-        $(JDK_OUTPUTDIR)/modules/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector \
-        META-INF/services/com.sun.jdi.connect.spi.TransportService \
-        META-INF/services/com.sun.tools.attach.spi.AttachProvider \
-        META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
-        META-INF/services/com.sun.tools.internal.xjc.Plugin, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/tools.jar, \
-    SKIP_METAINF := true, \
-    CHECK_COMPRESS_JAR := true))
-
-
-##########################################################################################
-
-include CORE_PKGS.gmk
-include NON_CORE_PKGS.gmk
-
-# The compiler should not issue a "Proprietary" warning when compiling
-# classes in the com.sun.java.swing.plaf packages, since we've always
-# allowed, and even advocated, extending them (see bug 6476749).
-#
-# This approach is NOT to be used as a general purpose way to avoid such
-# compiler warnings for non-core packages. The correct way is to document
-# the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
-# definition.
-#
-# Swing has taken this approach only as a temporary measure to avoid
-# the compiler warnings until we can properly document these packages.
-# This is covered under 6491853.
-EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows \
-    com.sun.java.swing.plaf.motif \
-    com.sun.java.swing.plaf.gtk
-
-#
-# Include the exported private packages in ct.sym.
-# This is an interim solution until the ct.sym is replaced
-# with a new module system (being discussed for JDK 8).
-#
-EXPORTED_PRIVATE_PKGS = com.oracle.net \
-    com.oracle.nio
-
-$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
-	$(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
-	$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
-	$(JAVA) $(NEW_JAVAC) \
-	    -bootclasspath "$(IMAGES_OUTPUTDIR)/lib/rt.jar" \
-	    -XDprocess.packages -proc:only \
-	    -processor com.sun.tools.javac.sym.CreateSymbols \
-	    -Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
-	    -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
-	    -Acom.sun.tools.javac.sym.Profiles=profile-rtjar-includes.txt \
-	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
-	$(TOUCH) $@
-
-$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/symbols))
-$(eval $(call SetupArchive,BUILD_CT_SYM, $(IMAGES_OUTPUTDIR)/symbols/_the.symbols, \
-    SRCS := $(IMAGES_OUTPUTDIR)/symbols, \
-    INCLUDES := META-INF/sym, \
-    JAR := $(IMAGES_OUTPUTDIR)/lib/ct.sym, \
-    CHECK_COMPRESS_JAR := true))
-
-
-##########################################################################################
-
-ifdef OPENJDK
-    SRC_ZIP_INCLUDES = \
-        com \
-        java \
-        javax \
-        jdk \
-        org \
-        sun \
-        #
-    SRC_ZIP_EXCLUDES =
-else
-    SRC_ZIP_INCLUDES = \
-        com/sun/corba \
-        com/sun/image/codec/jpeg \
-        com/sun/imageio \
-        com/sun/java_cup \
-        com/sun/javadoc \
-        com/sun/java/swing \
-        com/sun/jmx \
-        com/sun/naming \
-        com/sun/org/apache \
-        com/sun/security/auth \
-        com/sun/security/jgss \
-        com/sun/source \
-        java \
-        javax/accessibility \
-        javax/annotation \
-        javax/imageio \
-        javax/lang \
-        javax/management \
-        javax/naming \
-        javax/print \
-        javax/rmi \
-        javax/script \
-        javax/security \
-        javax/sound \
-        javax/sql \
-        javax/swing \
-        javax/tools \
-        javax/xml \
-        org/ietf \
-        org/omg \
-        org/w3c/dom \
-        org/xml/sax \
-        #
-    SRC_ZIP_EXCLUDES = javax/swing/beaninfo
-endif
-
-SRC_ZIP_SRCS := $(wildcard \
-    $(JDK_TOPDIR)/src/*/share/classes \
-    $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
-    $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_API_DIR)/classes \
-    $(LANGTOOLS_TOPDIR)/src/*/share/classes \
-    $(CORBA_TOPDIR)/src/*/share/classes \
-    $(JAXP_TOPDIR)/src/*/share/classes \
-    $(JAXWS_TOPDIR)/src/*/share/classes \
-    $(JDK_OUTPUTDIR)/gensrc/j* \
-    $(JDK_OUTPUTDIR)/gendocsrc_rmic \
-    $(CORBA_OUTPUTDIR)/gensrc/j* \
-    ) \
-    #
-ifndef OPENJDK
-  SRC_ZIP_SRCS += $(wildcard $(JDK_TOPDIR)/src/closed/*/share/classes)
-endif
-
-# Need to copy launcher src files into desired directory structure
-# before zipping the sources.
-$(eval $(call SetupCopyFiles,COPY_LAUNCHER_SRC, \
-    SRC := $(JDK_TOPDIR)/src/java.base, \
-    DEST := $(IMAGES_OUTPUTDIR)/src/launcher, \
-    FLATTEN := true, \
-    FILES := $(wildcard \
-        $(JDK_TOPDIR)/src/java.base/share/native/launcher/* \
-        $(JDK_TOPDIR)/src/java.base/share/native/libjli/* \
-        $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli/java_md*)))
-
-LAUNCHER_ZIP_SRC := $(COPY_LAUNCHER_SRC)
-
-$(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
-
-# This dir needs to exist before macro is evaluated to avoid warning from find.
-$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/src))
-$(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
-    SRC := $(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src, \
-    INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \
-    EXCLUDES := $(SRC_ZIP_EXCLUDES), \
-    SUFFIXES := .java .c .h, \
-    ZIP := $(IMAGES_OUTPUTDIR)/src.zip, \
-    EXTRA_DEPS := $(LAUNCHER_ZIP_SRC)))
-
-##########################################################################################
-
-# This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
-# all jars can be found in one place when creating images in Images.gmk. It needs to be
-# done here so that clean targets can be simple and accurate.
-$(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(HOTSPOT_DIST)/lib/sa-jdi.jar
-	$(install-file)
-
-##########################################################################################
-#
-# sec-bin.zip is used by builds where the corresponding sources are not available
-#
-$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
-    SRC := $(JDK_OUTPUTDIR), \
-    INCLUDES := \
-        modules/java.base/javax/crypto \
-        modules/java.base/javax/crypto/spec \
-        modules/java.base/sun/security/internal/interfaces \
-        modules/java.base/sun/security/internal/spec \
-        modules/java.base/com/sun/crypto/provider \
-        modules/jdk.crypto.ec/sun/security/ec \
-        modules/jdk.crypto.mscapi/sun/security/mscapi \
-        modules/jdk.crypto.pkcs11/sun/security/pkcs11 \
-        modules/jdk.crypto.pkcs11/sun/security/pkcs11/wrapper \
-        modules/jdk.crypto.ucrypto/com/oracle/security/ucrypto \
-        modules/java.base/javax/net \
-        modules/java.base/javax/security/cert \
-        modules/java.base/com/sun/net/ssl \
-        modules/java.base/com/sun/security/cert \
-        modules/java.base/sun/net/www/protocol/https \
-        modules/java.base/sun/security/pkcs12 \
-        modules/java.base/sun/security/ssl \
-        modules/java.security.jgss/sun/security/krb5 \
-        modules/java.security.jgss/sun/security/krb5/internal \
-        modules/java.security.jgss/sun/security/krb5/internal/ccache \
-        modules/java.security.jgss/sun/security/krb5/internal/crypto \
-        modules/java.security.jgss/sun/security/krb5/internal/ktab \
-        modules/java.security.jgss/sun/security/krb5/internal/rcache \
-        modules/java.security.jgss/sun/security/krb5/internal/util, \
-    INCLUDE_FILES := modules/java.security.jgss/sun/security/jgss/spi/GSSContextSpi.class, \
-    EXCLUDES := modules/java.security.jgss/sun/security/krb5/internal/tools, \
-    ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip))
-
-JARS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
-
-##########################################################################################
-#
-# Windows specific binary security packages.
-#
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  # sec-windows-bin.zip is used by builds where the corresponding sources are not available
-  $(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \
-      SRC := $(JDK_OUTPUTDIR), \
-      INCLUDES := modules/java.security.jgss/sun/security/krb5/internal/tools, \
-      ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
-
-  JARS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
-
-  # JGSS files contain the native Kerberos library
-  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
-    JGSS_ZIP_NAME = jgss-windows-x64-bin.zip
-  else
-    JGSS_ZIP_NAME = jgss-windows-i586-bin.zip
-  endif
-
-  $(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP, \
-      SRC := $(JDK_OUTPUTDIR), \
-      INCLUDE_FILES := bin/w2k_lsa_auth.dll \
-          bin/w2k_lsa_auth.map \
-          bin/w2k_lsa_auth.pdb, \
-      ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
-
-  JARS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
-endif
-
-##########################################################################################
-
-# This rule copies all jars from jdk/lib/... to images/lib/... to avoid having to track 
-# which jars are where
-$(IMAGES_OUTPUTDIR)/lib/%: $(JDK_OUTPUTDIR)/lib/%
-	$(install-file)
-
-##########################################################################################
-
-# Import nashorn.jar from nashorn dist dir.
-$(IMAGES_OUTPUTDIR)/lib/ext/nashorn.jar: $(NASHORN_DIST)/nashorn.jar
-	$(install-file)
-
-##########################################################################################
-
-# Hook to include the corresponding custom file, if present.
-$(eval $(call IncludeCustomExtension, jdk, CreateJars.gmk))
-
-##########################################################################################
-
-all: $(JARS)
-
-.PHONY: default all
--- a/jdk/make/CreatePolicyJars.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-#
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-
-
-################################################################################
-
-US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-
-  US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED := \
-      $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/US_export_policy.jar
-  US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED := \
-      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy.jar
-
-  ifndef OPENJDK
-    #
-    # In past releases, Oracle JDK has had a separately downloadable set of
-    # policy files which has been a nightmare for deployment.
-    #
-    # Now if we're closed and limited (default for Oracle JDK), create
-    # an "unlimited_policy" directory that contains the unlimited policy
-    # files.  It will be up to the user/deployer to make an informed choice
-    # as to whether they are legally entitled to use the unlimited policy
-    # file in their environment.  Users/deployers simply need to overwrite
-    # the files.  Consult README.txt (below) for more info.
-    #
-    UNLIMITED_POLICY_DIR := $(JDK_OUTPUTDIR)/lib/security/unlimited_policy
-  endif
-
-  #
-  # TODO fix so that SetupArchive does not write files into SRCS
-  # then we don't need this extra copying
-  #
-  # NOTE: We currently do not place restrictions on our limited export
-  # policy. This was not a typo. This means we are shipping the same file
-  # for both limited and unlimited US_export_policy.jar.  Only the local
-  # policy file currently has restrictions.
-  #
-  US_EXPORT_POLICY_JAR_SRC_DIR := \
-      $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
-  US_EXPORT_POLICY_JAR_TMP := \
-      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy_jar.tmp
-
-  $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
-	$(install-file)
-
-  US_EXPORT_POLICY_JAR_DEPS := \
-      $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
-
-  $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
-      $(US_EXPORT_POLICY_JAR_DEPS), \
-      SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED), \
-      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
-      SKIP_METAINF := true))
-
-  $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED): \
-      $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
-		$(ECHO) $(LOG_INFO) \
-		    Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-		$(install-file)
-
-  TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED) \
-      $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
-endif
-
-ifeq ($(UNLIMITED_CRYPTO), true)
-  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
-	$(install-file)
-else
-  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED)
-	$(install-file)
-endif 
-
-ifndef OPENJDK
-  ifneq ($(UNLIMITED_CRYPTO), true)
-    $(UNLIMITED_POLICY_DIR)/US_export_policy.jar: \
-        $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
-		$(install-file)
-    TARGETS += $(UNLIMITED_POLICY_DIR)/US_export_policy.jar
-  endif
-endif
-
-POLICY_JARS += $(US_EXPORT_POLICY_JAR_DST)
-
-################################################################################
-
-LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-
-  LOCAL_POLICY_JAR_LIMITED_UNSIGNED := \
-      $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/local_policy.jar
-  LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED := \
-      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy.jar
-
-  #
-  # TODO fix so that SetupArchive does not write files into SRCS
-  # then we don't need this extra copying
-  #
-  LOCAL_POLICY_JAR_LIMITED_TMP := \
-      $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/local_policy_jar.tmp
-  LOCAL_POLICY_JAR_UNLIMITED_TMP := \
-      $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy_jar.tmp
-
-  $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
-      $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
-		$(install-file)
-
-  $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
-      $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
-		$(install-file)
-
-  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
-      $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
-      $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
-      SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED), \
-      EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
-      SKIP_METAINF := true))
-
-  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
-      $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
-      SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED), \
-      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
-      SKIP_METAINF := true))
-
-  TARGETS += $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED) \
-      $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
-
-  ifndef OPENJDK
-    ifneq ($(UNLIMITED_CRYPTO), true)
-      $(UNLIMITED_POLICY_DIR)/README.txt: \
-          $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
-		$(install-file)
-
-      TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
-    endif
-  endif
-endif
-
-ifeq ($(UNLIMITED_CRYPTO), true)
-  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
-	$(install-file)
-else 
-  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED)
-	$(install-file)
-endif 
-
-ifndef OPENJDK
-  ifneq ($(UNLIMITED_CRYPTO), true)
-    $(UNLIMITED_POLICY_DIR)/local_policy.jar: \
-        $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
-		$(install-file) 
-    TARGETS += $(UNLIMITED_POLICY_DIR)/local_policy.jar
-  endif
-endif
-
-POLICY_JARS += $(LOCAL_POLICY_JAR_DST)
-TARGETS += $(POLICY_JARS)
-
-################################################################################
-
-all: $(TARGETS)
-
--- a/jdk/make/CreateSecurityJars.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-#
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-
-##########################################################################################
-# Create manifest for security jars
-#
-# Include these extra attributes for now, should probably take out.
-#
-MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
-JCE_MANIFEST := $(JDK_OUTPUTDIR)/jce/unsigned/_the.security.manifest.mf
-
-$(JCE_MANIFEST): $(MAINMANIFEST)
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \
-	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
-	    $(MAINMANIFEST) >> $@.tmp
-	$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
-	$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
-	$(ECHO) "Release-Version: $(RELEASE)" >> $@.tmp
-	$(MV) $@.tmp $@
-
-##########################################################################################
-# For crypto jars, always build the jar.
-#
-# The source for the crypto jars is not available for all licensees.
-# The BUILD_CRYPTO variable is set to no if these jars can't be built
-# to skip that step of the build.
-
-SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
-SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunpkcs11.jar
-
-$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
-    SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.pkcs11, \
-    SUFFIXES := .class, \
-    INCLUDES := sun/security/pkcs11, \
-    JAR := $(SUNPKCS11_JAR_UNSIGNED), \
-    MANIFEST := $(JCE_MANIFEST), \
-    SKIP_METAINF := true))
-
-$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-$(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
-	$(install-file)
-
-TARGETS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
-
-##########################################################################################
-
-SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
-SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunec.jar
-
-$(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
-    SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ec, \
-    SUFFIXES := .class, \
-    INCLUDES := sun/security/ec, \
-    JAR := $(SUNEC_JAR_UNSIGNED), \
-    MANIFEST := $(JCE_MANIFEST), \
-    SKIP_METAINF := true))
-
-$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-$(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
-	$(install-file)
-
-TARGETS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
-
-##########################################################################################
-
-SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
-SUNJCE_PROVIDER_JAR_UNSIGNED := \
-    $(JDK_OUTPUTDIR)/jce/unsigned/sunjce_provider.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-  $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
-      SRCS := $(JDK_OUTPUTDIR)/modules/java.base, \
-      SUFFIXES := .class, \
-      INCLUDES := com/sun/crypto/provider, \
-      JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \
-      MANIFEST := $(JCE_MANIFEST), \
-      SKIP_METAINF := true))
-
-  $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-  TARGETS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
-endif
-
-$(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
-	$(install-file)
-
-TARGETS += $(SUNJCE_PROVIDER_JAR_DST)
-
-##########################################################################################
-
-JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
-JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/jce.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-  $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
-      SRCS := $(JDK_OUTPUTDIR)/modules/java.base, \
-      SUFFIXES := .class, \
-      INCLUDES := javax/crypto sun/security/internal, \
-      JAR := $(JCE_JAR_UNSIGNED), \
-      MANIFEST := $(JCE_MANIFEST), \
-      SKIP_METAINF := true))
-
-  $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-  TARGETS += $(JCE_JAR_UNSIGNED)
-endif
-
-$(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
-	$(install-file)
-
-TARGETS += $(JCE_JAR_DST)
-
-##########################################################################################
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
-
-  SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
-  SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunmscapi.jar
-
-  $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
-      SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.mscapi, \
-      SUFFIXES := .class, \
-      INCLUDES := sun/security/mscapi, \
-      JAR := $(SUNMSCAPI_JAR_UNSIGNED), \
-      MANIFEST := $(JCE_MANIFEST), \
-      SKIP_METAINF := true))
-
-  $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-  $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
-	$(install-file)
-
-  TARGETS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
-
-endif
-
-##########################################################################################
-
-ifeq ($(OPENJDK_TARGET_OS), solaris)
-
-  UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
-  UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
-
-  $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
-      SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ucrypto, \
-      SUFFIXES := .class, \
-      INCLUDES := com/oracle/security/ucrypto, \
-      JAR := $(UCRYPTO_JAR_UNSIGNED), \
-      MANIFEST := $(JCE_MANIFEST), \
-      SKIP_METAINF := true))
-
-  $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-  $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_UNSIGNED)
-	$(install-file)
-
-  TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
-
-endif
-
-all: $(TARGETS)
-
-.PHONY: default all
--- a/jdk/make/Images.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,782 +0,0 @@
-#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-
-default: images
-
-# Prepare the find cache.
-$(eval $(call FillCacheFind, \
-    $(wildcard $(JDK_OUTPUTDIR)/bin \
-        $(JDK_OUTPUTDIR)/lib \
-        $(IMAGES_OUTPUTDIR)/lib \
-        $(JDK_OUTPUTDIR)/include \
-        $(JDK_OUTPUTDIR)/sample \
-        $(JDK_OUTPUTDIR)/demo)))
-
-include Tools.gmk
-
-include Profiles.gmk
-
-# Note: This double-colon rule is intentional, to support
-# custom make file integration.
-images:: jre-image jdk-image
-
-overlay-images: jre-overlay-image jdk-overlay-image
-
-
-
-# Processing license files from source area to image area
-# These will be modified to have the platform specific EOL chars.
-define process-doc-file
-	$(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	LC_ALL=C $(SED) 's/$$//g' $< > $@
-	$(CHMOD) 444 $@
-endef
-
-define AddFileToCopy
-  # Param 1 - src root dir
-  # Param 2 - dest root dir
-  # Param 3 - src file
-  # Param 4 - variable to add targets to
-
-  # Remove src dir root from src file
-  $2_$3_FILE := $$(patsubst $1/%,%,$3)
-
-  $2/$$($2_$3_FILE): $3
-	$(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
-	$$(install-file)
-
-  $4 += $2/$$($2_$3_FILE)
-endef
-
-################################################################################
-#
-# JRE and JDK build rules
-#
-################################################################################
-#
-# Variable prefixes explained:
-# JRE_ refers to files in the j2re-*-image.
-# JDK_ refers to files in the j2sdk-image outside of the jre subdir.
-# JDKJRE_ refers to files in the j2sdk-image inside the jre subdir.
-#
-
-################################################################################
-# /bin dir
-
-ifeq ($(PROFILE), )
-  NOT_JRE_BIN_FILES := \
-      appletviewer$(EXE_SUFFIX) \
-      idlj$(EXE_SUFFIX) \
-      jar$(EXE_SUFFIX) \
-      jarsigner$(EXE_SUFFIX) \
-      java-rmi.cgi \
-      javac$(EXE_SUFFIX) \
-      javadoc$(EXE_SUFFIX) \
-      javah$(EXE_SUFFIX) \
-      javap$(EXE_SUFFIX) \
-      jdeps$(EXE_SUFFIX) \
-      jcmd$(EXE_SUFFIX) \
-      jdb$(EXE_SUFFIX) \
-      jps$(EXE_SUFFIX) \
-      jrunscript$(EXE_SUFFIX) \
-      jstat$(EXE_SUFFIX) \
-      jstatd$(EXE_SUFFIX) \
-      jstack$(EXE_SUFFIX) \
-      packagebean$(SCRIPT_SUFFIX) \
-      rmic$(EXE_SUFFIX) \
-      serialver$(EXE_SUFFIX) \
-      unregbean$(EXE_SUFFIX) \
-      jconsole$(EXE_SUFFIX) \
-      jinfo$(EXE_SUFFIX) \
-      jmap$(EXE_SUFFIX) \
-      native2ascii$(EXE_SUFFIX) \
-      xjc$(EXE_SUFFIX) \
-      wsgen$(EXE_SUFFIX) \
-      wsimport$(EXE_SUFFIX) \
-      schemagen$(EXE_SUFFIX) \
-      jsadebugd$(EXE_SUFFIX) \
-      jhat$(EXE_SUFFIX)
-endif
-
-WINDOWS_JDK_BIN_FILES = \
-    $(EXE_SUFFIX) \
-    $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
-    $(notdir $(MSVCR_DLL))
-
-WINDOWS_JDKJRE_BIN_FILES := \
-    $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
-    $(SALIB_NAME)
-
-# Find all files in bin dir
-ALL_BIN_LIST := $(call CacheFind, $(JDK_OUTPUTDIR)/bin)
-
-# Prevent sjavac from entering the images.
-ALL_BIN_LIST := $(filter-out %/sjavac, $(ALL_BIN_LIST))
-
-# For unknown reason the debuginfo files for executables are not put into images
-# e.g filter them out
-ifneq ($(OPENJDK_TARGET_OS), windows)
-  ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
-else
-  # On windows, the libraries are in the bin dir, only filter out debuginfo files
-  # for executables. "java" is both a library and executable.
-  ALL_BIN_EXEC_FILES := $(filter-out java.exe, $(notdir $(filter %.exe, $(ALL_BIN_LIST))))
-  ALL_BIN_DEBUG_FILTER := $(addprefix %, $(patsubst %.exe, %.debuginfo, $(ALL_BIN_EXEC_FILES)) \
-      $(patsubst %.exe, %.diz, $(ALL_BIN_EXEC_FILES))) %.pdb
-  ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER), $(ALL_BIN_LIST))
-endif
-
-JDKJRE_BIN_LIST := $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST))
-JRE_BIN_LIST := $(filter-out $(addprefix %, $(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJRE_BIN_LIST))
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  JDK_BIN_LIST := $(filter $(addprefix %, $(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
-  # On windows x86, the server jvm is filtered out from the j2re image. This could possibly
-  # be handled by profiles in the future. If no client jvm is built, leave server in.
-  ifeq ($(OPENJDK_TARGET_CPU), x86)
-    ifeq ($(JVM_VARIANT_CLIENT), true)
-      JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
-    endif
-  endif
-else
-  JDK_BIN_LIST := $(ALL_BIN_LIST)
-endif
-
-ifneq ($(OPENJDK_TARGET_CPU_ISADIR), )
-  OVERLAY_FILTER := $(JDK_OUTPUTDIR)/bin$(OPENJDK_TARGET_CPU_ISADIR)%
-endif
-
-$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JRE_BIN_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
-$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
-$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
-
-$(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
-$(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
-$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
-
-################################################################################
-# /lib dir
-ifneq ($(OPENJDK_TARGET_OS), macosx)
-  JDKJRE_LIB_FILES := \
-      $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
-      $(SALIB_NAME)
-endif
-
-ifeq ($(PROFILE), )
-  NOT_JRE_LIB_FILES := \
-      tools.jar \
-      jconsole.jar \
-      sa-jdi.jar \
-      dt.jar \
-      ct.sym
-
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    NOT_JRE_LIB_FILES += jawt.lib jvm.lib
-  endif
-endif
-
-JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
-ifeq ($(OPENJDK_TARGET_OS), linux)
-  JDK_LIB_FILES += jexec
-endif
-
-ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),) # If Linux or Solaris
-    JDK_LIB_FILES += $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
-		     $(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)
-endif
-
-# Find all files to copy from $(JDK_OUTPUTDIR)/lib
-# Jar files are not expected to be here
-ALL_JDKOUT_LIB_LIST := $(call not-containing,_the., $(filter-out %.jar, \
-    $(call CacheFind, $(JDK_OUTPUTDIR)/lib)))
-# Find all files to copy from $(IMAGES_OUTPUTDIR)/lib
-# This is were the jar files are and might not exist if building overlay-images
-ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib), )
-  ALL_IMAGES_LIB_LIST := $(call not-containing,_the., \
-      $(call CacheFind, $(IMAGES_OUTPUTDIR)/lib))
-endif
-
-# Filter files to copy for each destination
-JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
-    $(ALL_JDKOUT_LIB_LIST))
-JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES)), $(ALL_JDKOUT_LIB_LIST))
-JDK_JDKOUT_LIB_LIST := $(filter $(addprefix %, $(JDK_LIB_FILES)), $(ALL_JDKOUT_LIB_LIST))
-
-JRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
-    $(ALL_IMAGES_LIB_LIST))
-JDKJRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES)), $(ALL_IMAGES_LIB_LIST))
-JDK_IMAGES_LIB_LIST := $(filter $(addprefix %, $(JDK_LIB_FILES)), $(ALL_IMAGES_LIB_LIST))
-
-# Iterate over files to copy to create rules for each one
-$(foreach f,$(JRE_JDKOUT_LIB_LIST), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS)))
-$(foreach f,$(JDK_JDKOUT_LIB_LIST), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS)))
-$(foreach f,$(JDKJRE_JDKOUT_LIB_LIST), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS)))
-
-$(foreach f,$(JRE_IMAGES_LIB_LIST), \
-    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS)))
-$(foreach f,$(JDK_IMAGES_LIB_LIST), \
-    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS)))
-$(foreach f,$(JDKJRE_IMAGES_LIB_LIST), \
-    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS)))
-
-$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JRE_JDKOUT_LIB_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_OVERLAY_LIB_TARGETS)))
-$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_JDKOUT_LIB_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_OVERLAY_LIB_TARGETS)))
-$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_OVERLAY_LIB_TARGETS)))
-
-ifneq ($(PROFILE), )
-  # Files in lib$(PROFILE) are excluded from the generic copying routines so
-  # we have to add them back in here
-  $(foreach f,$(CUSTOM_PROFILE_JARS), \
-      $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
-endif
-
-# CTE plugin security change require new empty directory lib/applet
-$(JRE_IMAGE_DIR)/lib/applet:
-	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $@
-
-$(JDK_IMAGE_DIR)/jre/lib/applet:
-	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $@
-
-$(JRE_IMAGE_DIR)/lib/meta-index: $(JRE_LIB_TARGETS)
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
-
-$(JDK_IMAGE_DIR)/jre/lib/meta-index: $(JDKJRE_LIB_TARGETS)
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
-
-$(JRE_IMAGE_DIR)/lib/ext/meta-index: $(JRE_LIB_TARGETS)
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
-
-$(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JDKJRE_LIB_TARGETS)
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
-
-################################################################################
-# /man dir
-#
-# All variables in this section are assigned with simple =, without :, to enable
-# more selective overriding from the custom version of this file.
-#
-# Avoid evaluating this whole section on windows for speed and stability
-ifneq ($(OPENJDK_TARGET_OS), windows)
-  JRE_MAN_PAGES = \
-      java.1 \
-      jjs.1 \
-      keytool.1 \
-      orbd.1 \
-      pack200.1 \
-      policytool.1 \
-      rmid.1 \
-      rmiregistry.1 \
-      servertool.1 \
-      tnameserv.1 \
-      unpack200.1
-
-  ifndef OPENJDK
-    ifneq ($(OPENJDK_TARGET_OS), solaris)
-      JRE_MAN_PAGES += javaws.1
-    endif
-  endif
-
-  JDK_MAN_PAGES = \
-      $(JRE_MAN_PAGES) \
-      appletviewer.1 \
-      idlj.1 \
-      jar.1 \
-      jarsigner.1 \
-      javac.1 \
-      javadoc.1 \
-      javah.1 \
-      javap.1 \
-      jconsole.1 \
-      jcmd.1 \
-      jdb.1 \
-      jdeps.1 \
-      jhat.1 \
-      jinfo.1 \
-      jmap.1 \
-      jps.1 \
-      jrunscript.1 \
-      jsadebugd.1 \
-      jstack.1 \
-      jstat.1 \
-      jstatd.1 \
-      native2ascii.1 \
-      rmic.1 \
-      schemagen.1 \
-      serialver.1 \
-      wsgen.1 \
-      wsimport.1 \
-      xjc.1
-
-  # This variable is potentially overridden in the closed makefile.
-  MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src
-
-  ifeq ($(OPENJDK_TARGET_OS), linux)
-    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
-    MAN1_SUBDIR = man
-  endif
-  ifeq ($(OPENJDK_TARGET_OS), solaris)
-    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
-    MAN1_SUBDIR = sun/man/man1
-  endif
-  ifeq ($(OPENJDK_TARGET_OS), macosx)
-    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
-    MAN1_SUBDIR = man
-  endif
-
-  $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
-	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(install-file)
-
-  $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
-	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(install-file)
-
-  $(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
-	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(install-file)
-
-  $(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
-	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(install-file)
-
-  define install-ja-manpage
-	$(MKDIR) -p $(@D)
-	$(CAT) $< \
-	    | $(NATIVE2ASCII) -encoding eucJP \
-	    | $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
-	    | $(NATIVE2ASCII) -reverse -encoding $1 \
-	    > $@
-  endef
-
-  $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, UTF-8)
-
-  $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, UTF-8)
-
-  $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, PCK)
-
-  $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, PCK)
-
-  ifeq ($(OPENJDK_TARGET_OS), solaris)
-    $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(install-file)
-
-    $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(install-file)
-  endif
-
-  ifeq ($(OPENJDK_TARGET_OS), linux)
-    $(JRE_IMAGE_DIR)/man/ja:
-	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
-
-    $(JDK_IMAGE_DIR)/man/ja:
-	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
-  endif
-
-  ifeq ($(OPENJDK_TARGET_OS), macosx)
-    $(JRE_IMAGE_DIR)/man/ja:
-	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
-
-    $(JDK_IMAGE_DIR)/man/ja:
-	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
-  endif
-
-  ifeq ($(OPENJDK_TARGET_OS), linux)
-    JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
-        $(JRE_IMAGE_DIR)/man/ja
-
-    JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
-        $(JDK_IMAGE_DIR)/man/ja
-  endif
-
-  ifeq ($(OPENJDK_TARGET_OS), solaris)
-    JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
-
-    JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
-  endif
-
-  ifeq ($(OPENJDK_TARGET_OS), macosx)
-    JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
-        $(JRE_IMAGE_DIR)/man/ja
-
-    JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
-        $(JDK_IMAGE_DIR)/man/ja
-  endif
-
-endif # Windows
-
-################################################################################
-# /demo dir
-
-# FIXME: demo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied.
-
-# The db demo contains an empty dir that needs to be copied. The other
-# directories will always trigger the rule for recompile since
-# _the.list_of_packages files are touched.
-$(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/demo/%
-	if [ ! -d "$@" ]; then \
-	  $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \
-	  $(MKDIR) -p $(@D); \
-	  if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \
-	fi
-
-# Find all files including directories
-JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/demo/%, $(JDK_IMAGE_DIR)/demo/%, \
-    $(shell $(FIND) $(JDK_OUTPUTDIR)/demo ! \( -name "_the*" -o -name "javac_state" \) ))
-
-
-
-# Param 1 is source file
-define CreateOverlayDemoRule
-  $1_TARGET := $$(subst $(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR), \
-      $$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1))
-  $$($1_TARGET): $1
-	$(ECHO) $(LOG_INFO) Copying '$$(patsubst $(OUTPUT_ROOT)/%,%,$$@)'
-	$$(call install-file)
-
-  JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET)
-endef
-JDK_OVERLAY_DEMO_SOURCES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(JDK_OUTPUTDIR)/demo))
-$(foreach lib, $(JDK_OVERLAY_DEMO_SOURCES), $(eval $(call CreateOverlayDemoRule, $(lib))))
-
-################################################################################
-# /sample dir
-
-$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/sample), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_SAMPLE_TARGETS)))
-
-################################################################################
-# /db dir
-
-ifndef OPENJDK
-  DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db)
-
-  $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(DB_ZIP_DIR)/%
-	$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<)
-	$(RM) -r $(JDK_IMAGE_DIR)/db
-	$(MKDIR) -p $(JDK_IMAGE_DIR)/db
-	cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x */index.html */KEYS */test/* *javadoc/* */docs/* */demo/* 2> /dev/null
-	cd $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* . && $(RM) -r db-derby-*-bin
-	$(MKDIR) -p $(@D)
-	$(TOUCH) $@
-
-  $(JDK_IMAGE_DIR)/db/README-JDK.html: $(DB_ZIP_DIR)/README-JDK.html
-	$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
-	$(MKDIR) -p $(@D)
-	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@
-
-  $(JDK_IMAGE_DIR)/db/3RDPARTY: $(DB_ZIP_DIR)/3RDPARTY
-	$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
-	$(MKDIR) -p $(@D)
-	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@
-
-  JDK_DB_TARGETS := $(patsubst $(DB_ZIP_DIR)/%, $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped, \
-      $(wildcard $(DB_ZIP_DIR)/*.zip)) \
-      $(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY
-
-endif
-
-################################################################################
-# /include dir
-
-$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/include), \
-    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_INCLUDE_TARGETS)))
-
-################################################################################
-# doc files
-
-ifdef OPENJDK
-  JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
-  JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
-  JRE_DOC_LOCATION := $(JDK_TOPDIR)
-  JDK_DOC_LOCATION := $(JDK_TOPDIR)
-else
-  JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
-  JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    JRE_DOC_FILES += README.txt
-  else
-    JRE_DOC_FILES += README
-  endif
-  JDK_DOC_FILES += demo/DEMOS_LICENSE sample/SAMPLES_LICENSE
-  JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/doc/jre
-  JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/doc/jdk
-endif
-JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/, $(JRE_DOC_FILES))
-JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/, $(JRE_DOC_FILES))
-JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES))
-
-$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
-	$(process-doc-file)
-
-$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/%
-	$(process-doc-file)
-
-$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README
-	$(process-doc-file)
-
-$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README
-	$(process-doc-file)
-
-$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
-	$(process-doc-file)
-
-$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/%
-	$(process-doc-file)
-
-$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/%
-	$(process-doc-file)
-
-JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
-JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
-
-JRE_OVERLAY_INFO_FILE := $(JRE_OVERLAY_IMAGE_DIR)/release
-JDK_OVERLAY_INFO_FILE := $(JDK_OVERLAY_IMAGE_DIR)/release
-
-# Common way to emit a line into the release or info file
-define info-file-item # name value
-	$(PRINTF) '%s="%s"\n' $1 $2 >> $@
-endef
-
-define create-info-file
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
-	$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)")
-	$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
-	$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
-	if [ -n "$(JDK_ARCH_ABI_PROP_NAME)" ]; then $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"); fi
-	$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)")
-endef
-
-ALL_SOURCE_TIPS = $(shell \
-    if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
-      $(CAT) $(OUTPUT_ROOT)/source_tips ; \
-    fi)
-
-$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call create-info-file)
-        ifneq ($(PROFILE), )
-	  $(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))")
-        endif
-
-$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call create-info-file)
-
-$(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call create-info-file)
-
-$(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
-	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call create-info-file)
-
-$(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip
-	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(install-file)
-
-################################################################################
-# Post processing (strip etc)
-
-ifneq ($(POST_STRIP_CMD), )
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    EXEC_LIST_BIN := $(filter-out %$(notdir $(MSVCR_DLL)), $(filter %.exe %.dll, $(ALL_BIN_LIST)))
-  else
-    # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
-    EXEC_LIST_BIN := $(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX) ! -name \*.debuginfo` \
-        | $(EGREP) 'ELF' | $(CUT) -d':' -f1)
-    # On mac, the old build searches for static libraries for stripping instead of shared.
-    # Not clear if it's intentional.
-    ifneq ($(OPENJDK_TARGET_OS), macosx)
-      EXEC_LIST_LIB := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX))
-    endif
-  endif
-  # Filter out sjavac
-  EXEC_LIST_BIN := $(filter-out %sjavac$(EXE_SUFFIX), $(EXEC_LIST_BIN))
-
-  # Filter out the overlay specific bin files
-  EXEC_LIST := $(filter-out $(OVERLAY_FILTER), $(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
-  EXEC_LIST_OVERLAY := $(filter $(OVERLAY_FILTER), $(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
-
-  # Filter out non JRE files and convert to unique touch files to depend on
-  JRE_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped, \
-      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
-      $(EXEC_LIST)))
-
-  JDKJRE_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
-      $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
-      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
-
-  JDK_BIN_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
-      $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
-      $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
-
-  # Do the same for overlay image
-  JRE_OVERLAY_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped, \
-      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
-      $(EXEC_LIST_OVERLAY)))
-
-  JDKJRE_OVERLAY_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
-      $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \
-      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY)))
-
-  JDK_OVERLAY_BIN_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
-      $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \
-      $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY)))
-
-  define mcs-file
-	$(if $(POST_MCS_CMD), $(POST_MCS_CMD) $<)
-  endef
-
-  define strip-file
-	$(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<)
-	$(CHMOD) u+w $<
-	$(POST_STRIP_CMD) $<
-	$(call mcs-file)
-	$(CHMOD) go-w $<
-	$(MKDIR) -p $(@D)
-	$(TOUCH) $@
-  endef
-
-  # Setup a rule for stripping files based on touch files
-  $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped: $(JRE_IMAGE_DIR)/%
-	$(call strip-file)
-
-  $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/%
-	$(call strip-file)
-
-  $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/%
-	$(call strip-file)
-
-  $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/%
-	$(call strip-file)
-
-endif
-
-################################################################################
-
-# Include the custom makefile right here, after all variables have been defined
-# so that they may be overridden, but before the main targets are declared, so 
-# that overriding has an effect.
-$(eval $(call IncludeCustomExtension, jdk, Images.gmk))
-
-################################################################################
-# Main targets
-
-jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \
-    $(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
-    $(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) \
-    $(JRE_BIN_ISADIR_LINK_TARGETS)
-
-jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
-    $(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
-    $(JDK_IMAGE_DIR)/jre/lib/applet \
-    $(JDK_DEMO_TARGETS) \
-    $(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \
-    $(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
-    $(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
-    $(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
-    $(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \
-    $(JDK_IMAGE_DIR)/src.zip \
-    $(JDK_BIN_ISADIR_LINK_TARGETS) $(JDKJRE_BIN_ISADIR_LINK_TARGETS)
-
-jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \
-    $(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST)
-
-jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \
-    $(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \
-    $(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \
-    $(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST)
-
-ifneq ($(PROFILE), )
-  PROFILE_IMAGE_JARS := $(filter %.jar, $(JRE_LIB_TARGETS))
-
-  PROFILE_IMAGE_JARS_CHECKED := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_jars_checked
-
-  $(PROFILE_IMAGE_JARS_CHECKED) : $(PROFILE_IMAGE_JARS)
-	$(TOOL_CHECKDEPS) $(JRE_IMAGE_DIR) \
-	    $(call profile_name, $(call profile_number, $(PROFILE)))
-	$(TOUCH) $@
-
-  profile-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) \
-	$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
-	$(JRE_INFO_FILE) $(JRE_STRIP_LIST) $(PROFILE_IMAGE_JARS_CHECKED)
-
-  .PHONY: profile-image
-
-endif # Profile
-
-################################################################################
-
-.PHONY: default images jre-image jdk-image
--- a/jdk/make/Import.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/Import.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -31,34 +31,53 @@
 ################################################################################
 
 # Put the libraries here. Different locations for different target apis.
-ifeq ($(OPENJDK_TARGET_OS_API), posix)
-  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
+ifneq ($(OPENJDK_TARGET_OS), windows)
   HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)
+  BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
+  SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent$(OPENJDK_TARGET_CPU_LIBDIR)
 else
-  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/bin
   HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/bin
+  BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
+  SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent
 endif
 
 ################################################################################
-
-define CopyDir
-  $1_SRC_FILES := $(shell $(FIND) $2 -type f -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE),$4) \))
-  $1_DST_FILES := $$(patsubst $2/%,$3/%,$$($1_SRC_FILES))
-  HOTSPOT_IMPORT_TARGET_FILES += $$($1_DST_FILES)
-  $3/%: $2/%
-	$(ECHO) $(LOG_INFO) Copying $$(@F)
-	$$(install-file)
-endef
-
-################################################################################
-
 #
 # Import hotspot
 #
-HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
-    Xusage.txt sa-jdi.jar
-$(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
-$(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
+HOTSPOT_BASE_IMPORT_FILES := \
+    $(addprefix $(LIBRARY_PREFIX), jvm.* jsig.* jvm_db.* jvm_dtrace.*) \
+    Xusage.txt \
+    #
+
+HOTSPOT_SA_IMPORT_FILES := \
+    $(addprefix $(LIBRARY_PREFIX), saproc.* sawindbg.*) \
+    #
+
+$(eval $(call SetupCopyFiles,COPY_HOTSPOT_BASE, \
+    SRC := $(HOTSPOT_LIB_DIR), \
+    DEST := $(BASE_INSTALL_LIBRARIES_HERE), \
+    FILES := $(shell $(FIND) $(HOTSPOT_LIB_DIR) -type f  \
+        -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE), $(HOTSPOT_BASE_IMPORT_FILES)) \) )))
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  $(eval $(call SetupCopyFiles,COPY_HOTSPOT_BASE_JVMLIB, \
+      SRC := $(HOTSPOT_DIST)/lib, \
+      DEST := $(BASE_INSTALL_LIBRARIES_HERE), \
+      FILES := $(wildcard $(HOTSPOT_DIST)/lib/*.lib)))
+endif
+
+BASE_TARGETS := $(COPY_HOTSPOT_BASE) $(COPY_HOTSPOT_BASE_JVMLIB)
+
+$(eval $(call SetupCopyFiles,COPY_HOTSPOT_SA, \
+    SRC := $(HOTSPOT_LIB_DIR), \
+    DEST := $(SA_INSTALL_LIBRARIES_HERE), \
+    FILES := $(shell $(FIND) $(HOTSPOT_LIB_DIR) -type f  \
+        -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE), $(HOTSPOT_SA_IMPORT_FILES)) \) )))
+
+SA_TARGETS := $(COPY_HOTSPOT_SA)
+
+################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
@@ -70,39 +89,39 @@
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
   ifeq ($(JVM_VARIANT_SERVER), true)
-    HOTSPOT_IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
+    BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
     ifneq (, $(JSIG_DEBUGINFO))
-      HOTSPOT_IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
+      BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/server/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
     endif
   endif
   ifeq ($(JVM_VARIANT_CLIENT), true)
-    HOTSPOT_IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
+    BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
     ifneq (, $(JSIG_DEBUGINFO))
-      HOTSPOT_IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
+      BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
     endif
   endif
   ifneq ($(OPENJDK_TARGET_OS), macosx)
     ifeq ($(JVM_VARIANT_MINIMAL1), true)
-      HOTSPOT_IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
+      BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
       ifneq (,$(JSIG_DEBUGINFO))
-        HOTSPOT_IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
+        BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
       endif
     endif
   endif
 endif
 
-$(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
+$(BASE_INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(BASE_INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  $(INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
+  $(BASE_INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(BASE_INSTALL_LIBRARIES_HERE)/%.dSYM
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-  $(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(BASE_INSTALL_LIBRARIES_HERE)/server/%.diz : $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
@@ -111,12 +130,12 @@
 	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
 	$(MV) $@.tmp $@
 else
-  $(INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+  $(BASE_INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(BASE_INSTALL_LIBRARIES_HERE)/%.debuginfo
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-  $(INSTALL_LIBRARIES_HERE)/server/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(BASE_INSTALL_LIBRARIES_HERE)/server/%.diz: $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@).debuginfo
@@ -126,18 +145,18 @@
 	$(MV) $@.tmp $@
 endif
 
-$(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
+$(BASE_INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX): $(BASE_INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  $(INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
+  $(BASE_INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(BASE_INSTALL_LIBRARIES_HERE)/%.dSYM
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-  $(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(BASE_INSTALL_LIBRARIES_HERE)/client/%.diz : $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
@@ -146,12 +165,12 @@
 	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
 	$(MV) $@.tmp $@
 else
-  $(INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+  $(BASE_INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(BASE_INSTALL_LIBRARIES_HERE)/%.debuginfo
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-  $(INSTALL_LIBRARIES_HERE)/client/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(BASE_INSTALL_LIBRARIES_HERE)/client/%.diz: $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@).debuginfo
@@ -161,18 +180,18 @@
 	$(MV) $@.tmp $@
 endif
 
-$(INSTALL_LIBRARIES_HERE)/minimal/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
+$(BASE_INSTALL_LIBRARIES_HERE)/minimal/%$(SHARED_LIBRARY_SUFFIX): $(BASE_INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
 ifneq ($(OPENJDK_TARGET_OS), macosx)
-  $(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+  $(BASE_INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(BASE_INSTALL_LIBRARIES_HERE)/%.debuginfo
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-  $(INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(BASE_INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@).debuginfo
@@ -182,10 +201,69 @@
 	$(MV) $@.tmp $@
 endif
 
-##########################################################################################
+################################################################################
 
-hotspot: $(HOTSPOT_IMPORT_TARGET_FILES)
+$(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/_the.sa.jar.unpacked: $(HOTSPOT_DIST)/lib/sa-jdi.jar \
+    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
+	$(ECHO) $(LOG_INFO) Unzipping $(<F)
+	$(RM) -r $(@D)
+	$(MKDIR) -p $(@D)
+	$(CD) $(@D) && $(UNZIP) $< -x META-INF/MANIFEST.MF $(LOG_DEBUG)
+        # We must move the service provider file out of the way so that
+        # Gensrc-jdk.jdi.gmk can combine them.
+	$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
+	$(MV) $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector \
+	    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
+	$(TOUCH) $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
+	$(TOUCH) $@
 
-all: hotspot
+# Declaring this dependency guarantees that _the.sa.services will be rebuilt
+# even if zip is already unpacked.
+$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services: $(HOTSPOT_DIST)/lib/sa-jdi.jar
 
-.PHONY: hotspot all
+SA_TARGETS += $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/_the.sa.jar.unpacked \
+    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
+
+################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  $(eval $(call SetupCopyFiles,BASE_COPY_LIBS_BIN, \
+      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
+      DEST := $(JDK_OUTPUTDIR)/bin, \
+      FILES := $(filter-out %.lib, $(BASE_TARGETS))))
+
+  $(eval $(call SetupCopyFiles,BASE_COPY_LIBS_LIB, \
+      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
+      DEST := $(JDK_OUTPUTDIR)/lib, \
+      FILES := $(filter %.lib, $(BASE_TARGETS))))
+
+  $(eval $(call SetupCopyFiles,SA_COPY_LIBS, \
+      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent, \
+      DEST := $(JDK_OUTPUTDIR)/lib, \
+      FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent/%, \
+          $(SA_TARGETS))))
+
+  $(eval $(call SetupCopyFiles,SA_COPY_LIBS, \
+      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent, \
+      DEST := $(JDK_OUTPUTDIR)/bin, \
+      FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent/%, \
+          $(SA_TARGETS))))
+else
+  $(eval $(call SetupCopyFiles,BASE_COPY_LIBS, \
+      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
+      DEST := $(JDK_OUTPUTDIR)/lib, \
+      FILES := $(BASE_TARGETS)))
+
+  $(eval $(call SetupCopyFiles,SA_COPY_LIBS, \
+      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent, \
+      DEST := $(JDK_OUTPUTDIR)/lib, \
+      FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent/%, $(SA_TARGETS))))
+endif
+
+################################################################################
+
+all: $(BASE_TARGETS) $(SA_TARGETS) \
+    $(BASE_COPY_LIBS_BIN) $(BASE_COPY_LIBS_LIB) \
+    $(BASE_COPY_LIBS) $(SA_COPY_LIBS)
+
+.PHONY: default all
--- a/jdk/make/ProfileNames.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# This was split out from Profiles.gmk to allow GenSrcMisc.gmk to include it
-# without attempting to generate lists for output files that don't exist yet
-
-# These are the external names of each profile
-
-PROFILE_NAMES := compact1 compact2 compact3
-
-# The include files use 1,2,3 for simplicity and conciseness. Internally we
-# use profile_1, profile_2 and profile_3.
-
-ALL_PROFILES := profile_1 profile_2 profile_3
-
-# This defines targets to generate per-profile Version.java/class files into
-# distinct locations
-
-VERSION_JAVA_DIR := sun/misc
-VERSION_JAVA_FILE := Version.java
-VERSION_JAVA_PATH := $(VERSION_JAVA_DIR)/$(VERSION_JAVA_FILE)
-VERSION_CLASS_PATH := $(VERSION_JAVA_PATH:.java=.class)
-
-PROFILE_VERSION_JAVA_TARGETS := $(foreach i, $(ALL_PROFILES), $(subst XXX,$i, $(JDK_OUTPUTDIR)/gen_XXX/$(VERSION_JAVA_PATH)))
-
-PROFILE_VERSION_CLASS_TARGETS := $(foreach i, $(PROFILE_VERSION_JAVA_TARGETS), $(i:.java=.class))
-
-# Function to map from profile designator, profile_1 etc, to its number
-profile_number = $(if $(patsubst profile_%,%, $(1)), $(patsubst profile_%,%, $(1)), $(words $(PROFILE_NAMES) extra))
-
-# Function to map from profile number, 1, 2 etc, to the corresponding name
-# An invalid number maps to an empty name
-profile_name = $(word $(1), $(PROFILE_NAMES))
-
-# Function to isolate a profile number from a Version.java target
-# Evaluates to the arg if the arg is not a profile version target
-profile_version_number = $(patsubst $(JDK_OUTPUTDIR)/gen_profile_%/$(VERSION_JAVA_PATH), %, $(1))
-
-# Function to go from a profile Version.java target to profile name. If not
-# a profile version target then we need a number that maps to an empty name
-profile_version_name = $(word $(if $(filter-out $(call profile_version_number, $(1)), $(1)), $(call profile_version_number, $(1)), $(words $(PROFILE_NAMES) extra)), $(PROFILE_NAMES))
--- a/jdk/make/Profiles.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,324 +0,0 @@
-#
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-include ProfileNames.gmk
-
-# This defines the include lists for each profile, categorized as lib, bin
-# and other. We can use these to define the file lists for each profile
-# directly, rather than constructing a set of files to exclude from the
-# set of all files. But initially we will stick with generating exclude lists
-# as that is how the main build process already works.
-
-include profile-includes.txt
-
-###############################################################################
-# Per profile Jar lists
-#
-# These are the jar files to be built. In some builds these have to be
-# imported (signed jars) rather than built.
-#
-# The incoming lists, eg PROFILE_1_JRE_JARS_FILES, are the jars to be
-# included in this profile. They have the jar name relative to the lib
-# directory. We have to turn these into targets by adding the
-# $(IMAGES_OUTPUTDIR)/lib prefix
-#
-# Note that some jars may be optional depending on the type of build (jdk vs.
-# openjdk) and the platform.
-#
-# WARNING: incoming lists are currently validated for linux only!
-###############################################################################
-
-# These are jar files for which the contents vary depending on the profile
-CUSTOM_JARS := rt.jar resources.jar
-# This is used in Images.gmk
-CUSTOM_PROFILE_JARS := $(addprefix $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/, $(CUSTOM_JARS))
-
-# These are the common jar files built for and included with this profile
-# Filter out the custom jars and turn them into targets.
-
-PROFILE_1_JARS := \
-    $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(filter-out $(CUSTOM_JARS), $(PROFILE_1_JRE_JAR_FILES)))
-
-PROFILE_2_JARS := \
-    $(if $(PROFILE_2_JRE_JAR_FILES), $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_2_JRE_JAR_FILES))) \
-    $(PROFILE_1_JARS)
-
-PROFILE_3_JARS := \
-    $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_3_JRE_JAR_FILES)) \
-    $(PROFILE_2_JARS)
-
-ifneq ($(ENABLE_JFR), true)
-  FULL_JRE_JAR_FILES := $(filter-out jfr.jar, $(FULL_JRE_JAR_FILES))
-endif
-
-FULL_JRE_JARS := \
-    $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(FULL_JRE_JAR_FILES)) \
-    $(PROFILE_3_JARS)
-
-# The full set of "jar" files needed for a complete JDK (ct.sym and src.zip
-# are also included.)
-# Note we need to add back the regular form of all the custom profile jars e.g.
-# rt.jar and resources.jar that we filtered out above
-
-ALL_JARS := $(FULL_JRE_JARS) \
-    $(IMAGES_OUTPUTDIR)/lib/rt.jar \
-    $(IMAGES_OUTPUTDIR)/lib/resources.jar \
-    $(IMAGES_OUTPUTDIR)/lib/jconsole.jar \
-    $(IMAGES_OUTPUTDIR)/lib/dt.jar \
-    $(IMAGES_OUTPUTDIR)/lib/tools.jar \
-    $(IMAGES_OUTPUTDIR)/lib/ct.sym \
-    $(IMAGES_OUTPUTDIR)/src.zip
-
-ifeq ($(INCLUDE_SA), true)
-  ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), solaris)
-  ifndef OPENJDK
-    ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
-  endif
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
-endif
-
-ifeq ($(PROFILE), profile_1)
-  PROFILE_JARS := $(PROFILE_1_JARS)
-else ifeq ($(PROFILE), profile_2)
-  PROFILE_JARS := $(PROFILE_2_JARS)
-else ifeq ($(PROFILE), profile_3)
-  PROFILE_JARS := $(PROFILE_3_JARS)
-endif
-ifneq ($(PROFILE), )
-  JARS := $(CUSTOM_PROFILE_JARS) $(PROFILE_JARS)
-else
-  JARS := $(ALL_JARS)
-endif
-
-###############################################################################
-# JRE contents
-###############################################################################
-
-
-# we don't need to do anything if not building a profile
-ifneq ($(PROFILE), )
-
-
-# Need all files to generate the exclude lists
-NEW_ALL_BIN_LIST := $(patsubst $(JDK_OUTPUTDIR)/bin/%,%,$(shell $(FIND) $(JDK_OUTPUTDIR)/bin \( -type f -o -type l \) ! -name "sjavac"))
-
-ALL_JRE_BIN_FILES := \
-    $(PROFILE_1_JRE_BIN_FILES) \
-    $(PROFILE_2_JRE_BIN_FILES) \
-    $(PROFILE_3_JRE_BIN_FILES) \
-    $(FULL_JRE_BIN_FILES)
-
-NOT_JRE_BIN_FILES := $(filter-out $(ALL_JRE_BIN_FILES), $(NEW_ALL_BIN_LIST))
-
-# Additional exclusions for profile JRE
-ifeq ($(PROFILE), profile_1)
-  NOT_JRE_BIN_FILES += \
-      $(PROFILE_2_JRE_BIN_FILES) \
-      $(PROFILE_3_JRE_BIN_FILES) \
-      $(FULL_JRE_BIN_FILES)
-endif
-
-ifeq ($(PROFILE), profile_2)
-  NOT_JRE_BIN_FILES += \
-      $(PROFILE_3_JRE_BIN_FILES) \
-      $(FULL_JRE_BIN_FILES)
-endif
-
-ifeq ($(PROFILE), profile_3)
-  NOT_JRE_BIN_FILES += \
-      $(FULL_JRE_BIN_FILES)
-endif
-
-NOT_JRE_BIN_FILES := $(addprefix $(JDK_OUTPUTDIR)/bin/, $(NOT_JRE_BIN_FILES))
-
-# Need all files to generate the exclude lists
-NEW_ALL_LIB_LIST := $(patsubst $(JDK_OUTPUTDIR)/lib/%,%,$(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \( -name "_the*" -o -name "javac_state " \) ))
-NEW_ALL_LIB_LIST += $(patsubst $(IMAGES_OUTPUTDIR)/lib/%,%,$(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \( -name "_the*" -o -name "javac_state " \) ))
-
-ALL_JRE_LIB_FILES := \
-    $(PROFILE_1_JRE_LIB_FILES) \
-    $(PROFILE_2_JRE_LIB_FILES) \
-    $(PROFILE_3_JRE_LIB_FILES) \
-    $(FULL_JRE_LIB_FILES)
-
-NOT_JRE_LIB_FILES := $(filter-out $(ALL_JRE_LIB_FILES), $(NEW_ALL_LIB_LIST))
-
-# Although these are NOT JRE lib files we have to filter them from the list
-# (ie cause them to be added them back in here) because the logic in
-# Images.gmk expects them to be there and handles them differently.
-# If we don't, they end up in the wrong place in the JDK image.
-# This needs fixing.
-NOT_JRE_LIB_FILES := $(filter-out $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(SALIB_NAME), $(NOT_JRE_LIB_FILES))
-
-# Additional exclusions for profile JREs
-ifeq ($(PROFILE), profile_1)
-  NOT_JRE_LIB_FILES += \
-      $(PROFILE_2_JRE_LIB_FILES) \
-      $(PROFILE_3_JRE_LIB_FILES) \
-      $(FULL_JRE_LIB_FILES)
-endif
-
-ifeq ($(PROFILE), profile_2)
-  NOT_JRE_LIB_FILES += \
-      $(PROFILE_3_JRE_LIB_FILES) \
-      $(FULL_JRE_LIB_FILES)
-endif
-
-ifeq ($(PROFILE), profile_3)
-  NOT_JRE_LIB_FILES += \
-      $(FULL_JRE_LIB_FILES)
-endif
-
-# Exclude the custom jar files as these will be added back via a special rule
-NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
-
-###############################################################################
-# Customization of rt.jar file contents
-# These are expressed as exclusions from everything found in the
-# JDK_OUTPUTDIR/classes directory
-###############################################################################
-
-# The main set of excluded types/packages (ie everything not destined to be
-# part of rt.jar or resources.jar is captured in the CreateJars.gmk RT_JAR_EXCLUDES
-# variable. We add to that for the per-profile exclusion lists
-
-# For each profile we have four variables:
-#
-# - PROFILE_n_RTJAR_INCLUDE_PACKAGES
-#
-# This is a package prefix indicating that all classes in that package
-# and conditionally its subpackages are included in rt.jar for this profile.
-# The subpackages will be included as long as they do not appear in the
-# include list of a higher profile
-#
-# - PROFILE_n_RTJAR_INCLUDE_TYPES
-#
-# These are specific types that must be included within a package.
-# There are two cases:
-# - individual types in a package that is otherwise excluded at this
-#   profile level. The only arises if there are split packages.
-#
-# - A higher-level package is included in a high profile where a subpackage
-# is included in a lower profile. Including the package in the high profile
-# would exclude it and all subpackages from the lower profile, so instead
-# the classes in the package are listed for that higher profile (as *.class)
-#
-# These types are explicitly added back into the rt.jar content lists.
-#
-# - PROFILE_n_RTJAR_EXCLUDE_TYPES
-#
-# These are specific types that must be excluded even though most of the
-# containing package is include. Again this occurs with split packges.
-#
-# So the exclude list for each profile consists of the include lists
-# for all profiles above it, together with any explicitly excluded types.
-# This is then combined with the overall RT_JAR_EXCLUDES list (which covers
-# things that go into other jar files).
-#
-# We also have to define the types to be explicitly included. This
-# accumulates up the profiles ie profile 3 has to include the types
-# that profiles 1 and 2 had to include. This is unnecessary if, for example,
-# profile 3 includes the entire package, but it is harmless to add them
-# explicitly, and complex to determine if we still need to include them.
-#
-# Need a way to express:
-#  for (int i = profile+1; i < 4; i++)
-#     RT_JAR_EXCLUDES += PROFILE_$i_RTJAR_INCLUDE_PACKAGES
-#
-# Do it the long way for now
-#
-# - PROFILE_n_INCLUDE_METAINF_SERVICES
-#
-# These are META-INF/services/ entries found in resources.jar. Together
-# resources.jar and rt.jar hold the contents of the classes directory, (the
-# classes in rt.jar and everything else in resources.jar).Hence the
-# include/exclude information for resources.jar is tied to that of rt.jar
-
-include profile-rtjar-includes.txt
-
-# Function to expand foo/*.class into the set of classes
-# NOTE: Files found by wildcard are stipped of extra $, so call DoubleDollar
-# to keep the file names compatible with make.
-# But note that if you echo these values they will NOT display as expected.
-class_list = $(foreach dir, $(JDK_OUT_CLASSES), $(patsubst $(dir)/%,%, \
-    $(foreach i, $(1), $(call DoubleDollar, $(wildcard $(dir)/$i)))))
-
-ifeq ($(PROFILE), profile_1)
-  RT_JAR_EXCLUDES += \
-      $(call class_list, $(PROFILE_1_RTJAR_EXCLUDE_TYPES)) \
-      $(PROFILE_2_RTJAR_INCLUDE_PACKAGES) \
-      $(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \
-      $(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \
-      $(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \
-      $(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \
-      $(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES))
-  RT_JAR_INCLUDE_TYPES := \
-      $(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES))
-  PROFILE_INCLUDE_METAINF_SERVICES := \
-      $(PROFILE_1_INCLUDE_METAINF_SERVICES)
-endif
-ifeq ($(PROFILE), profile_2)
-  RT_JAR_EXCLUDES += \
-      $(call class_list, $(PROFILE_2_RTJAR_EXCLUDE_TYPES)) \
-      $(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \
-      $(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \
-      $(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \
-      $(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES))
-  RT_JAR_INCLUDE_TYPES := \
-      $(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \
-      $(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES))
-  PROFILE_INCLUDE_METAINF_SERVICES := \
-      $(PROFILE_1_INCLUDE_METAINF_SERVICES) \
-      $(PROFILE_2_INCLUDE_METAINF_SERVICES)
-endif
-ifeq ($(PROFILE), profile_3)
-  RT_JAR_EXCLUDES += \
-      $(call class_list, $(PROFILE_3_RTJAR_EXCLUDE_TYPES)) \
-      $(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \
-      $(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES))
-  RT_JAR_INCLUDE_TYPES := \
-      $(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \
-      $(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \
-      $(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES))
-  PROFILE_INCLUDE_METAINF_SERVICES := \
-      $(PROFILE_1_INCLUDE_METAINF_SERVICES) \
-      $(PROFILE_2_INCLUDE_METAINF_SERVICES) \
-      $(PROFILE_3_INCLUDE_METAINF_SERVICES)
-endif
-
-# Filter out non-OpenJDK services
-ifdef OPENJDK
-  EXCLUDED_SERVICES := META-INF/services/javax.script.ScriptEngineFactory
-  PROFILE_INCLUDE_METAINF_SERVICES := $(filter-out $(EXCLUDED_SERVICES), $(PROFILE_INCLUDE_METAINF_SERVICES))
-endif
-
-
-endif # profile
--- a/jdk/make/Tools.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/Tools.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -38,104 +38,124 @@
 ifeq (, $(BUILD_TOOLS_JDK))
   $(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
       SETUP := GENERATE_OLDBYTECODE, \
+      ADD_JAVAC_FLAGS := "-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes", \
       SRC := $(JDK_TOPDIR)/make/src/classes, \
-      BIN := $(JDK_OUTPUTDIR)/btclasses))
+      BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
+      COPY := boot.modules ext.modules))
 endif
 
-$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/%.template: \
+$(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources/%.template: \
     $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/%.template
 	$(call install-file)
 
-BUILD_TOOLS_JDK += $(foreach i, $(wildcard $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template), $(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/$(notdir $i))
+BUILD_TOOLS_JDK += $(foreach i, $(wildcard $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template), $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources/$(notdir $i))
 
 # Resource used by CheckDeps tool
-$(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed: \
+$(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/deps/refs.allowed: \
     $(JDK_TOPDIR)/make/data/checkdeps/refs.allowed
 	$(call install-file)
 
-BUILD_TOOLS_JDK += $(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed
+BUILD_TOOLS_JDK += $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/deps/refs.allowed
 
 # Add a checksum ("jsum") to the end of a text file. Prevents trivial tampering with class lists.
-TOOL_ADDJSUM = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_ADDJSUM = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.addjsum.AddJsum
 
 # The buildmetaindex tool creates a meta-index to make core class loaders lazier.
-TOOL_BUILDMETAINDEX = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_BUILDMETAINDEX = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.buildmetaindex.BuildMetaIndex
 
-TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.compilefontconfig.CompileFontConfig
 
-TOOL_COMPILEPROPERTIES = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_COMPILEPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.compileproperties.CompileProperties
 
-TOOL_JARREORDER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_JARREORDER = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.jarreorder.JarReorder
 
-TOOL_GENERATECHARACTER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_GENERATECHARACTER = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.generatecharacter.GenerateCharacter
 
-TOOL_CHARACTERNAME = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_CHARACTERNAME = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.generatecharacter.CharacterName
 
 TOOL_DTDBUILDER = $(JAVA_SMALL) -Ddtd_home=$(JDK_TOPDIR)/make/data/dtdbuilder \
     -Djava.awt.headless=true \
-    -cp $(JDK_OUTPUTDIR)/btclasses build.tools.dtdbuilder.DTDBuilder
+    -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.dtdbuilder.DTDBuilder
 
 TOOL_GENERATEBREAKITERATORDATA = $(JAVA_SMALL) \
-    -cp $(JDK_OUTPUTDIR)/btclasses \
+    -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.generatebreakiteratordata.GenerateBreakIteratorData
 
-TOOL_GENERATECURRENCYDATA = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_GENERATECURRENCYDATA = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.generatecurrencydata.GenerateCurrencyData
 
-TOOL_HASHER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_HASHER = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.hasher.Hasher
 
-TOOL_TZDB = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_TZDB = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.tzdb.TzdbZoneRulesCompiler
 
-TOOL_BLACKLISTED_CERTS = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_BLACKLISTED_CERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.blacklistedcertsconverter.BlacklistedCertsConverter
 
-TOOL_MAKEJAVASECURITY = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_MAKEJAVASECURITY = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.makejavasecurity.MakeJavaSecurity
 
 
 # TODO: There are references to the jdwpgen.jar in jdk/make/netbeans/jdwpgen/build.xml
 # and nbproject/project.properties in the same dir. Needs to be looked at.
-TOOL_JDWPGEN = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.jdwpgen.Main
+TOOL_JDWPGEN = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.jdwpgen.Main
 
 # TODO: Lots of files in jdk/make/tools/CharsetMapping dir
-TOOL_CHARSETMAPPING = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_CHARSETMAPPING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.charsetmapping.Main $(LOG_INFO)
 
-TOOL_SPP = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.spp.Spp
+TOOL_SPP = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.spp.Spp
 
 # Nimbus is used somewhere in the swing build.
-TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.generatenimbus.Generator
 
-TOOL_WRAPPERGENERATOR = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_WRAPPERGENERATOR = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.x11wrappergen.WrapperGenerator
 
-TOOL_AWT_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_AWT_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.icondata.awt.ToBin
 
-TOOL_OSX_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_OSX_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.icondata.osxapp.ToBin
 
-TOOL_CLDRCONVERTER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+TOOL_CLDRCONVERTER = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.cldrconverter.CLDRConverter
 
 TOOL_CHECKDEPS = $(JAVA_SMALL) -Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR) \
-    -cp "$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)" \
+    -cp "$(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes$(PATH_SEP)$(JDK_OUTPUTDIR)" \
     build.tools.deps.CheckDeps
 
 TOOL_GENMODULESXML = $(JAVA_SMALL) -Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR) \
-    -cp "$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)" \
+    -cp "$(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes$(PATH_SEP)$(JDK_OUTPUTDIR)" \
     build.tools.module.GenJdepsModulesXml
 
+TOOL_IMAGEBUILDER = $(JAVA_SMALL) -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
+    -cp "$(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes$(PATH_SEP)$(JDK_OUTPUTDIR)" \
+    build.tools.module.ImageBuilder
+
+##########################################################################################
+
+JIMAGE_PKGS := \
+    jdk/internal/jimage \
+    jdk/internal/jrtfs \
+    #
+
+$(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+    INCLUDES := $(JIMAGE_PKGS), \
+    EXCLUDES := jdk/internal/jimage/concurrent, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes))
+
 ##########################################################################################
 
 # Tools needed on solaris because OBJCOPY is broken.
@@ -147,8 +167,8 @@
     CC := $(BUILD_CC), \
     LDEXE := $(BUILD_LD), \
     LDFLAGS := -lelf, \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/add_gnu_debuglink, \
-    OUTPUT_DIR := $(JDK_OUTPUTDIR)/btbin, \
+    OBJECT_DIR := $(BUILDTOOLS_OUTPUTDIR)/objs/add_gnu_debuglink, \
+    OUTPUT_DIR := $(BUILDTOOLS_OUTPUTDIR)/bin, \
     PROGRAM := add_gnu_debuglink))
 
 $(eval $(call SetupNativeCompilation,FIX_EMPTY_SEC_HDR_FLAGS, \
@@ -157,11 +177,13 @@
     CC := $(BUILD_CC), \
     LDEXE := $(BUILD_LD), \
     LDFLAGS := -lelf, \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags, \
-    OUTPUT_DIR := $(JDK_OUTPUTDIR)/btbin, \
+    OBJECT_DIR := $(BUILDTOOLS_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags, \
+    OUTPUT_DIR := $(BUILDTOOLS_OUTPUTDIR)/bin, \
     PROGRAM := fix_empty_sec_hdr_flags))
 endif
 
+$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE)
+
 java-tools: $(BUILD_TOOLS_JDK)
 
 all: java-tools
--- a/jdk/make/UnpackSecurity.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/UnpackSecurity.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,33 +37,44 @@
 
 define unzip-sec-file
 	$(ECHO) Unzipping $(<F)
-	$(MKDIR) -p $(@D)
+	$(MKDIR) -p $(@D) $(JDK_OUTPUTDIR)
 	$(RM) $@
 	($(CD) $(JDK_OUTPUTDIR) && $(UNZIP) -q -o $< > $@.tmp)
 	$(MV) $@.tmp $@
 endef
 
-$(JDK_OUTPUTDIR)/classes/_the.sec-bin.unzipped: $(SEC_FILES_ZIP)
+define unzip-native-sec-file
+	$(ECHO) Unzipping $(<F)
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	($(CD) $(SUPPORT_OUTPUTDIR) && $(UNZIP) -q -o $< > $@.tmp)
+	$(MV) $@.tmp $@
+endef
+
+$(SUPPORT_OUTPUTDIR)/_the.sec-bin.unzipped: $(SEC_FILES_ZIP)
 	$(call unzip-sec-file)
 
-$(JDK_OUTPUTDIR)/classes/_the.sec-windows-bin.unzipped: $(SEC_FILES_WIN_ZIP)
+# Trying to unzip both of the sec files at the same time may cause a race
+# when creating directories common to both files.
+$(SUPPORT_OUTPUTDIR)/_the.sec-windows-bin.unzipped: $(SEC_FILES_WIN_ZIP) \
+    | $(SUPPORT_OUTPUTDIR)/_the.sec-bin.unzipped
 	$(call unzip-sec-file)
 
-$(JDK_OUTPUTDIR)/classes/_the.jgss-windows-i586-bin.unzipped: $(JGSS_WIN32_FILES_ZIP)
-	$(call unzip-sec-file)
+$(SUPPORT_OUTPUTDIR)/_the.jgss-windows-i586-bin.unzipped: $(JGSS_WIN32_FILES_ZIP)
+	$(call unzip-native-sec-file)
 
-$(JDK_OUTPUTDIR)/classes/_the.jgss-windows-x64-bin.unzipped: $(JGSS_WIN64_FILES_ZIP)
-	$(call unzip-sec-file)
+$(SUPPORT_OUTPUTDIR)/_the.jgss-windows-x64-bin.unzipped: $(JGSS_WIN64_FILES_ZIP)
+	$(call unzip-native-sec-file)
 
 ifneq ($(wildcard $(SEC_FILES_ZIP)), )
-  IMPORT_TARGET_FILES += $(JDK_OUTPUTDIR)/classes/_the.sec-bin.unzipped
+  IMPORT_TARGET_FILES += $(SUPPORT_OUTPUTDIR)/_the.sec-bin.unzipped
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    IMPORT_TARGET_FILES += $(JDK_OUTPUTDIR)/classes/_the.sec-windows-bin.unzipped
+    IMPORT_TARGET_FILES += $(SUPPORT_OUTPUTDIR)/_the.sec-windows-bin.unzipped
     ifeq ($(OPENJDK_TARGET_CPU), x86)
-      IMPORT_TARGET_FILES += $(JDK_OUTPUTDIR)/classes/_the.jgss-windows-i586-bin.unzipped
+      IMPORT_TARGET_FILES += $(SUPPORT_OUTPUTDIR)/_the.jgss-windows-i586-bin.unzipped
     endif
     ifeq ($(OPENJDK_TARGET_CPU), x86_64)
-      IMPORT_TARGET_FILES += $(JDK_OUTPUTDIR)/classes/_the.jgss-windows-x64-bin.unzipped
+      IMPORT_TARGET_FILES += $(SUPPORT_OUTPUTDIR)/_the.jgss-windows-x64-bin.unzipped
     endif
   endif
 endif
--- a/jdk/make/copy/Copy-java.base.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-java.base.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -31,7 +31,7 @@
 #
 # Copy exported header files to outputdir.
 #
-JAVA_BASE_HEADERS := \
+TARGETS += \
     $(INCLUDE_DST_DIR)/jni.h \
     $(INCLUDE_DST_DIR)/jvmti.h \
     $(INCLUDE_DST_DIR)/jvmticmlr.h \
@@ -55,7 +55,7 @@
   $(LIB_DST_DIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
 	$(call install-file)
 
-  BASE_CONF_FILES += $(LIB_DST_DIR)/tzmappings
+  TARGETS += $(LIB_DST_DIR)/tzmappings
 
 endif
 
@@ -63,11 +63,13 @@
 # Copy msvcrXX.dll on windows
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
-  MSVCR_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCR_DLL))
+  MSVCR_TARGET := $(LIB_DST_DIR)/$(notdir $(MSVCR_DLL))
   # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
   $(MSVCR_TARGET): $(MSVCR_DLL)
 	$(call install-file)
 	$(CHMOD) a+rx $@
+
+  TARGETS += $(MSVCR_TARGET)
 endif
 
 ################################################################################
@@ -85,7 +87,7 @@
 else
   JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/conf/$(JVMCFG_ARCH)/jvm.cfg
 endif
-JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
+JVMCFG_DIR := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR)
 JVMCFG := $(JVMCFG_DIR)/jvm.cfg
 
 # To do: should this also support -zeroshark?
@@ -143,12 +145,12 @@
         endif
 endif
 
-BASE_CONF_FILES += $(JVMCFG)
+TARGETS += $(JVMCFG)
 
 ################################################################################
 
 POLICY_SRC := $(JDK_TOPDIR)/src/java.base/share/conf/security/java.policy
-POLICY_DST := $(JDK_OUTPUTDIR)/lib/security/java.policy
+POLICY_DST := $(CONF_DST_DIR)/security/java.policy
 
 POLICY_SRC_LIST :=
 
@@ -167,40 +169,34 @@
 	$(foreach f,$(POLICY_SRC_LIST),$(CAT) $(f) >> $@.tmp;)
 	$(MV) $@.tmp $@
 
-BASE_CONF_FILES += $(POLICY_DST)
+TARGETS += $(POLICY_DST)
 
 ################################################################################
 
 ifeq ($(CACERTS_FILE), )
   CACERTS_FILE := $(JDK_TOPDIR)/src/java.base/share/conf/security/cacerts
 endif
-CACERTS_DST := $(JDK_OUTPUTDIR)/lib/security/cacerts
+CACERTS_DST := $(LIB_DST_DIR)/security/cacerts
 
 $(CACERTS_DST): $(CACERTS_FILE)
 	$(call install-file)
 
-BASE_CONF_FILES += $(CACERTS_DST)
+TARGETS += $(CACERTS_DST)
 
 ################################################################################
 
-$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/java.base/share/conf/net.properties
+$(CONF_DST_DIR)/net.properties: $(JDK_TOPDIR)/src/java.base/share/conf/net.properties
 	$(ECHO) $(LOG_INFO) Copying $(@F)
 	$(call install-file)
 
-NET_CONF_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
+TARGETS += $(CONF_DST_DIR)/net.properties
 
 ifeq ($(OPENJDK_TARGET_OS), solaris)
-  $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/${OPENJDK_TARGET_OS_API_DIR}/conf/sdp/sdp.conf.template
+  $(CONF_DST_DIR)/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/${OPENJDK_TARGET_OS_API_DIR}/conf/sdp/sdp.conf.template
 	$(ECHO) $(LOG_INFO) Copying $(@F)
 	$(call install-file)
 
-  NET_CONF_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
+  TARGETS += $(CONF_DST_DIR)/sdp/sdp.conf.template
 endif
 
 ################################################################################
-
-java.base: $(BASE_CONF_FILES) $(NET_CONF_FILES) $(JAVA_BASE_HEADERS) $(MSVCR_TARGET)
-
-all: java.base
-
-.PHONY: all java.base
--- a/jdk/make/copy/Copy-java.desktop.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-java.desktop.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -29,7 +29,7 @@
 
 ################################################################################
 
-JAVA_DESKTOP_HEADERS := \
+TARGETS += \
     $(INCLUDE_DST_DIR)/jawt.h \
     $(INCLUDE_DST_OS_DIR)/jawt_md.h \
     #
@@ -62,9 +62,9 @@
   #TODO: rework this to avoid hardcoding library name in the makefile
   #
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    FREETYPE_TARGET_LIB := $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype)
+    FREETYPE_TARGET_LIB := $(LIB_DST_DIR)/$(call SHARED_LIBRARY,freetype)
   else
-    FREETYPE_TARGET_LIB := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6
+    FREETYPE_TARGET_LIB := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6
   endif
 
   # We can't use $(install-file) in this rule because it preserves symbolic links and
@@ -75,14 +75,16 @@
         ifeq ($(OPENJDK_BUILD_OS), windows)
 	  $(CHMOD) +rx $@
         endif
+
+  TARGETS += $(FREETYPE_TARGET_LIB)
 endif
 
 ################################################################################
 
-$(JDK_OUTPUTDIR)/lib/sound.properties: $(JDK_TOPDIR)/src/java.desktop/share/conf/sound.properties
+$(CONF_DST_DIR)/sound.properties: $(JDK_TOPDIR)/src/java.desktop/share/conf/sound.properties
 	$(call install-file)
 
-DESKTOP_CONF_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties
+TARGETS += $(CONF_DST_DIR)/sound.properties
 
 ################################################################################
 #
@@ -95,7 +97,7 @@
 $(LIB_DST_DIR)/%: $(PSFONTPROPFILE_SRC_DIR)/%
 	$(call install-file)
 
-DESKTOP_CONF_FILES += $(PSFONTPROPFILE_TARGET_FILES)
+TARGETS += $(PSFONTPROPFILE_TARGET_FILES)
 
 ################################################################################
 #
@@ -113,7 +115,7 @@
 $(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_OPENJDK_TARGET_OS_LIB_SRC)/cursors.properties
 	$(call install-file)
 
-DESKTOP_CONF_FILES += $(CURSORS_DEST_DIR)/cursors.properties
+TARGETS += $(CURSORS_DEST_DIR)/cursors.properties
 
 CURSORS_LIB_SRC := $(JDK_TOPDIR)/src/java.desktop/share/conf/images/cursors
 ifeq ($(OPENJDK_TARGET_OS), windows)
@@ -126,12 +128,6 @@
 $(CURSORS_DEST_DIR)/%: $(CURSORS_LIB_SRC)/%
 	$(call install-file)
 
-DESKTOP_CONF_FILES += $(CURSORS_TARGET_FILES)
+TARGETS += $(CURSORS_TARGET_FILES)
 
 ################################################################################
-
-java.desktop: $(DESKTOP_CONF_FILES) $(FREETYPE_TARGET_LIB) $(JAVA_DESKTOP_HEADERS)
-
-all: java.desktop
-
-.PHONY: all java.desktop
--- a/jdk/make/copy/Copy-java.logging.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-java.logging.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -29,15 +29,9 @@
 
 LOGGING_LIB_SRC := $(JDK_TOPDIR)/src/java.logging/share/conf
 
-$(LIB_DST_DIR)/logging.properties: $(LOGGING_LIB_SRC)/logging.properties
+$(CONF_DST_DIR)/logging.properties: $(LOGGING_LIB_SRC)/logging.properties
 	$(call install-file)
 
-LOGGING_CONF_FILES := $(LIB_DST_DIR)/logging.properties
+TARGETS := $(CONF_DST_DIR)/logging.properties
 
 ################################################################################
-
-java.logging: $(LOGGING_CONF_FILES)
-
-all: java.logging
-
-.PHONY: all java.logging
--- a/jdk/make/copy/Copy-java.management.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-java.management.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -27,30 +27,24 @@
 
 ################################################################################
 
-MGMT_LIBDIR := $(LIB_DST_DIR)/management
-MGMT_LIB_SRC := $(JDK_TOPDIR)/src/java.management/share/conf
-MGMT_SRC_FILES := $(wildcard $(MGMT_LIB_SRC)/*)
-MGMT_TARGET_FILES := $(subst $(MGMT_LIB_SRC),$(MGMT_LIBDIR),$(MGMT_SRC_FILES))
+MGMT_CONF_DIR := $(CONF_DST_DIR)/management
+MGMT_CONF_SRC := $(JDK_TOPDIR)/src/java.management/share/conf
+MGMT_SRC_FILES := $(wildcard $(MGMT_CONF_SRC)/*)
+MGMT_TARGET_FILES := $(subst $(MGMT_CONF_SRC),$(MGMT_CONF_DIR),$(MGMT_SRC_FILES))
 
-$(MGMT_LIBDIR)/management.properties: $(MGMT_LIB_SRC)/management.properties
+$(MGMT_CONF_DIR)/management.properties: $(MGMT_CONF_SRC)/management.properties
 	$(call install-file)
 	$(CHMOD) 644 $@
 
 # this file has different permissions...don't know why...
-$(MGMT_LIBDIR)/jmxremote.access: $(MGMT_LIB_SRC)/jmxremote.access
+$(MGMT_CONF_DIR)/jmxremote.access: $(MGMT_CONF_SRC)/jmxremote.access
 	$(call install-file)
 	$(CHMOD) 644 $@
 
-$(MGMT_LIBDIR)/%: $(MGMT_LIB_SRC)/%
+$(MGMT_CONF_DIR)/%: $(MGMT_CONF_SRC)/%
 	$(call install-file)
 	$(CHMOD) 444 $@
 
-MANAGEMENT_CONF_FILES := $(MGMT_TARGET_FILES)
+TARGETS := $(MGMT_TARGET_FILES)
 
 ################################################################################
-
-java.management: $(MANAGEMENT_CONF_FILES)
-
-all: java.management
-
-.PHONY: all java.management
--- a/jdk/make/copy/Copy-jdk.crypto.pkcs11.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-jdk.crypto.pkcs11.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -31,20 +31,15 @@
 
   SUNPKCS11_CFG_SRC := \
       $(JDK_TOPDIR)/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg
-  SUNPKCS11_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/sunpkcs11-solaris.cfg
+  SUNPKCS11_CFG_DST := $(CONF_DST_DIR)/security/sunpkcs11-solaris.cfg
 
   $(SUNPKCS11_CFG_DST): $(SUNPKCS11_CFG_SRC)
 	$(call install-file)
 
   SECURITY_PKCS11_CONF_FILES += $(SUNPKCS11_CFG_DST)
 
+  TARGETS := $(SUNPKCS11_CFG_DST)
+
 endif
 
 ################################################################################
-
-jdk.crypto.pkcs11: $(SECURITY_PKCS11_CONF_FILES)
-
-all: jdk.crypto.pkcs11
-
-.PHONY: all jdk.crypto.pkcs11
-
--- a/jdk/make/copy/Copy-jdk.crypto.ucrypto.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-jdk.crypto.ucrypto.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -30,20 +30,13 @@
 ifeq ($(OPENJDK_TARGET_OS), solaris)
 
   UCRYPTO_CFG_SRC := $(JDK_TOPDIR)/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg
-  UCRYPTO_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/ucrypto-solaris.cfg
+  UCRYPTO_CFG_DST := $(CONF_DST_DIR)/security/ucrypto-solaris.cfg
 
   $(UCRYPTO_CFG_DST): $(UCRYPTO_CFG_SRC)
 	$(call install-file)
 
-  SECURITY_UCRYPTO_CONF_FILES += $(UCRYPTO_CFG_DST)
+  TARGETS += $(UCRYPTO_CFG_DST)
 
 endif
 
 ################################################################################
-
-jdk.crypto.ucrypto: $(SECURITY_UCRYPTO_CONF_FILES)
-
-all: jdk.crypto.ucrypto
-
-.PHONY: all jdk.crypto.ucrypto
-
--- a/jdk/make/copy/Copy-jdk.hprof.agent.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-jdk.hprof.agent.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -32,12 +32,6 @@
 $(LIB_DST_DIR)/jvm.hprof.txt: $(HPROF_SRC)
 	$(call install-file)
 
-HPROF_CONF_FILES := $(LIB_DST_DIR)/jvm.hprof.txt
+TARGETS := $(LIB_DST_DIR)/jvm.hprof.txt
 
 ################################################################################
-
-jdk.hprof.agent: $(HPROF_CONF_FILES)
-
-all: jdk.hprof.agent
-
-.PHONY: all jdk.hprof.agent
--- a/jdk/make/copy/Copy-jdk.jdwp.agent.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/Copy-jdk.jdwp.agent.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -27,16 +27,9 @@
 
 ################################################################################
 
-
-JDK_DEBUG_AGENT_HEADERS := $(INCLUDE_DST_DIR)/jdwpTransport.h
+TARGETS := $(INCLUDE_DST_DIR)/jdwpTransport.h
 
 $(INCLUDE_DST_DIR)/%.h: $(JDK_TOPDIR)/src/jdk.jdwp.agent/share/native/include/%.h
 	$(call install-file)
 
 ################################################################################
-
-jdk.jdwp.agent: $(JDK_DEBUG_AGENT_HEADERS)
-
-all: jdk.jdwp.agent
-
-.PHONY: all jdk.jdwp.agent
--- a/jdk/make/copy/CopyCommon.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/copy/CopyCommon.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -23,13 +23,9 @@
 # questions.
 #
 
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-
-INCLUDE_DST_DIR := $(JDK_OUTPUTDIR)/include
-LIB_DST_DIR := $(JDK_OUTPUTDIR)/lib
+INCLUDE_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE)
+LIB_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)
+CONF_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE)
 
 INCLUDE_DST_OS_DIR := $(INCLUDE_DST_DIR)/$(OPENJDK_TARGET_OS)
 
--- a/jdk/make/gendata/Gendata-java.base.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/Gendata-java.base.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -29,15 +29,14 @@
 $(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-java.base.gmk))
 
 include GendataBreakIterator.gmk
-GENDATA += $(BREAK_ITERATOR)
 
 include GendataTZDB.gmk
-GENDATA += $(GENDATA_TZDB)
 
 include GendataBlacklistedCerts.gmk
-GENDATA += $(GENDATA_BLACKLISTED_CERTS)
 
-##########################################################################################
+include GendataPolicyJars.gmk
+
+################################################################################
 
 GENDATA_UNINAME := $(JDK_OUTPUTDIR)/modules/java.base/java/lang/uniName.dat
 
@@ -45,9 +44,9 @@
 	$(MKDIR) -p $(@D)
 	$(TOOL_CHARACTERNAME) $< $@
 
-GENDATA += $(GENDATA_UNINAME)
+TARGETS += $(GENDATA_UNINAME)
 
-##########################################################################################
+################################################################################
 
 GENDATA_CURDATA := $(JDK_OUTPUTDIR)/modules/java.base/java/util/currency.data
 
@@ -58,12 +57,12 @@
 	$(MV) $@.tmp $@
 	$(CHMOD) 444 $@
 
-GENDATA += $(GENDATA_CURDATA)
+TARGETS += $(GENDATA_CURDATA)
 
-##########################################################################################
+################################################################################
 
 GENDATA_JAVA_SECURITY_SRC := $(JDK_TOPDIR)/src/java.base/share/conf/security/java.security
-GENDATA_JAVA_SECURITY := $(JDK_OUTPUTDIR)/lib/security/java.security
+GENDATA_JAVA_SECURITY := $(SUPPORT_OUTPUTDIR)/modules_conf/java.base/security/java.security
 
 # RESTRICTED_PKGS_SRC is optionally set in custom extension for this makefile
 
@@ -73,14 +72,17 @@
 	$(TOOL_MAKEJAVASECURITY) $(GENDATA_JAVA_SECURITY_SRC) $@ $(OPENJDK_TARGET_OS) \
 		$(RESTRICTED_PKGS_SRC) || exit 1
 
-GENDATA += $(GENDATA_JAVA_SECURITY)
+TARGETS += $(GENDATA_JAVA_SECURITY)
 
-##########################################################################################
+################################################################################
 
-$(GENDATA): $(BUILD_TOOLS_JDK)
+$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist: \
+    $(JDK_TOPDIR)/make/data/classlist/classlist.$(OPENJDK_TARGET_OS)
+	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
+	$(TOOL_ADDJSUM) $< $@.tmp
+	$(MV) $@.tmp $@
 
-java.base: $(GENDATA)
+TARGETS += $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist
 
-all: java.base
-
-.PHONY: all java.base
+################################################################################
--- a/jdk/make/gendata/Gendata-java.desktop.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/Gendata-java.desktop.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -26,15 +26,5 @@
 include GendataCommon.gmk
 
 include GendataFontConfig.gmk
-GENDATA += $(GENDATA_FONT_CONFIG)
 
 include GendataHtml32dtd.gmk
-GENDATA += $(GENDATA_HTML32DTD)
-
-$(GENDATA): $(BUILD_TOOLS_JDK)
-
-java.desktop: $(GENDATA)
-
-all: $(GENDATA)
-
-.PHONY: all java.desktop
--- a/jdk/make/gendata/Gendata-jdk.dev.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/Gendata-jdk.dev.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -27,20 +27,16 @@
 
 $(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.dev.gmk))
 
-GENDATA := $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml
-METADATA_FILES += $(TOPDIR)/modules.xml
+JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml
+MODULES_XML += $(TOPDIR)/modules.xml
 
 #
 # Generate modules.xml for jdeps to use
 # It augments $(TOPDIR)/modules.xml to include module membership
 #
-$(GENDATA): $(BUILD_TOOLS_JDK) $(METADATA_FILES)
+$(JDEPS_MODULES_XML): $(BUILD_TOOLS_JDK) $(MODULES_XML)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
-	$(TOOL_GENMODULESXML) -o $@ -mp $(JDK_OUTPUTDIR)/modules $(METADATA_FILES)
+	$(TOOL_GENMODULESXML) -o $@ -mp $(JDK_OUTPUTDIR)/modules $(MODULES_XML)
 
-jdk.dev: $(GENDATA)
-
-all: $(GENDATA)
-
-.PHONY: all jdk.dev
+TARGETS += $(JDEPS_MODULES_XML)
--- a/jdk/make/gendata/GendataBlacklistedCerts.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/GendataBlacklistedCerts.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -24,7 +24,7 @@
 #
 
 GENDATA_BLACKLISTED_CERTS_SRC := $(JDK_TOPDIR)/make/data/blacklistedcertsconverter/blacklisted.certs.pem
-GENDATA_BLACKLISTED_CERTS := $(JDK_OUTPUTDIR)/lib/security/blacklisted.certs
+GENDATA_BLACKLISTED_CERTS := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/security/blacklisted.certs
 
 ifndef OPENJDK
 	GENDATA_BLACKLISTED_CERTS_SRC += $(wildcard $(JDK_TOPDIR)/make/closed/data/blacklistedcertsconverter/blacklisted.certs.pem)
@@ -34,3 +34,5 @@
 	$(ECHO) "Generating blacklisted certs"
 	$(MKDIR) -p $(@D)
 	($(CAT) $(GENDATA_BLACKLISTED_CERTS_SRC) | $(TOOL_BLACKLISTED_CERTS) > $@) || exit 1
+
+TARGETS += $(GENDATA_BLACKLISTED_CERTS)
--- a/jdk/make/gendata/GendataBreakIterator.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/GendataBreakIterator.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,17 +33,16 @@
 # They are used at JDK build phase in order to create $(BIFILES) which
 # are used on runtime instead.
 #
-TEXT_SRCDIR = $(JDK_TOPDIR)/src/java.base/share/classes \
+TEXT_SRCDIR := $(JDK_TOPDIR)/src/java.base/share/classes \
     $(JDK_TOPDIR)/src/jdk.localedata/share/classes
-TEXT_PKG = sun/text/resources
-TEXT_SOURCES = $(TEXT_PKG)/BreakIteratorRules.java \
+TEXT_PKG := sun/text/resources
+TEXT_SOURCES := $(TEXT_PKG)/BreakIteratorRules.java \
     $(TEXT_PKG)/BreakIteratorInfo.java \
     $(TEXT_PKG)/th/BreakIteratorRules_th.java \
     $(TEXT_PKG)/th/BreakIteratorInfo_th.java
 
 # Generate BreakIteratorData
-BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator
-BREAK_ITERATOR_CLASSES = $(BREAK_ITERATOR_DIR)/classes
+BREAK_ITERATOR_CLASSES := $(BUILDTOOLS_OUTPUTDIR)/break_iterator_classes
 
 # JAVAC_SOURCE_PATH_OVERRIDE is set to isolate the compile to just those
 # two files in that directory and not get anything implicit from
@@ -62,16 +61,16 @@
 
 # Generate data resource files.
 # input
-UNICODEDATA = $(JDK_TOPDIR)/make/data/unicodedata/UnicodeData.txt
+UNICODEDATA := $(JDK_TOPDIR)/make/data/unicodedata/UnicodeData.txt
 
 # output
-BASE_DATA_PKG_DIR = $(JDK_OUTPUTDIR)/modules/java.base/sun/text/resources
-SL_DATA_PKG_DIR = $(JDK_OUTPUTDIR)/modules/jdk.localedata/sun/text/resources
-BIFILES = $(BASE_DATA_PKG_DIR)/CharacterBreakIteratorData \
+BASE_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/java.base/sun/text/resources
+SL_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/jdk.localedata/sun/text/resources
+BIFILES := $(BASE_DATA_PKG_DIR)/CharacterBreakIteratorData \
     $(BASE_DATA_PKG_DIR)/WordBreakIteratorData \
     $(BASE_DATA_PKG_DIR)/LineBreakIteratorData \
     $(BASE_DATA_PKG_DIR)/SentenceBreakIteratorData
-BIFILES_TH = $(SA_DATA_PKG_DIR)/th/WordBreakIteratorData_th \
+BIFILES_TH := $(SA_DATA_PKG_DIR)/th/WordBreakIteratorData_th \
     $(SA_DATA_PKG_DIR)/th/LineBreakIteratorData_th
 
 $(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles
@@ -97,5 +96,4 @@
 	    -language th
 	$(TOUCH) $@
 
-
-BREAK_ITERATOR += $(BIFILES) $(BIFILES_TH)
+TARGETS += $(BIFILES) $(BIFILES_TH)
--- a/jdk/make/gendata/GendataCommon.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/GendataCommon.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -23,10 +23,6 @@
 # questions.
 #
 
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
 include JavaCompilation.gmk
 include SetupJavaCompilers.gmk
 # We need the tools.
--- a/jdk/make/gendata/GendataFontConfig.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/GendataFontConfig.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 # questions.
 #
 
-GENDATA_FONT_CONFIG_DST := $(JDK_OUTPUTDIR)/lib
+GENDATA_FONT_CONFIG_DST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)
 
 GENDATA_FONT_CONFIG_DATA_DIR := $(JDK_TOPDIR)/make/data/fontconfig
 ifndef OPENJDK
@@ -42,7 +42,7 @@
 
 $(GENDATA_FONT_CONFIG_DST)/%.bfc: \
     $(GENDATA_FONT_CONFIG_DATA_DIR)/$(OPENJDK_TARGET_OS).%.properties \
-    $(BUILD_TOOLS)
+    $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(TOOL_COMPILEFONTCONFIG) $< $@
@@ -54,5 +54,5 @@
 GENDATA_BFONT_CONFIGS := $(patsubst $(GENDATA_FONT_CONFIG_DATA_DIR)/$(OPENJDK_TARGET_OS).%.properties, \
     $(GENDATA_FONT_CONFIG_DST)/%.bfc, $(GENDATA_FONT_CONFIG_SRC_FILES))
 
-GENDATA_FONT_CONFIG := $(GENDATA_FONT_CONFIGS) $(GENDATA_BFONT_CONFIGS)
+TARGETS := $(GENDATA_FONT_CONFIGS) $(GENDATA_BFONT_CONFIGS)
 
--- a/jdk/make/gendata/GendataHtml32dtd.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/GendataHtml32dtd.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -26,10 +26,10 @@
 GENDATA_HTML32DTD :=
 
 HTML32DTD = $(JDK_OUTPUTDIR)/modules/java.desktop/javax/swing/text/html/parser/html32.bdtd
-$(HTML32DTD): $(BUILD_TOOLS)
+$(HTML32DTD): $(BUILD_TOOLS_JDK)
 	$(ECHO) "Generating HTML DTD file"
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	($(TOOL_DTDBUILDER) $(LOG_INFO) html32 > $@) || exit 1
 
-GENDATA_HTML32DTD += $(HTML32DTD)
+TARGETS += $(HTML32DTD)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/gendata/GendataPolicyJars.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -0,0 +1,197 @@
+#
+# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+
+
+################################################################################
+
+US_EXPORT_POLICY_JAR_DST := \
+    $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/US_export_policy.jar
+
+ifneq ($(BUILD_CRYPTO), no)
+
+  US_EXPORT_POLICY_JAR_LIMITED := \
+      $(SUPPORT_OUTPUTDIR)/jce/policy/limited/US_export_policy.jar
+  US_EXPORT_POLICY_JAR_UNLIMITED := \
+      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy.jar
+
+  ifndef OPENJDK
+    #
+    # In past releases, Oracle JDK has had a separately downloadable set of
+    # policy files which has been a nightmare for deployment.
+    #
+    # Now if we're closed and limited (default for Oracle JDK), create
+    # an "unlimited_policy" directory that contains the unlimited policy
+    # files.  It will be up to the user/deployer to make an informed choice
+    # as to whether they are legally entitled to use the unlimited policy
+    # file in their environment.  Users/deployers simply need to overwrite
+    # the files.  Consult README.txt (below) for more info.
+    #
+    UNLIMITED_POLICY_DIR := \
+        $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/unlimited_policy
+  endif
+
+  #
+  # TODO fix so that SetupArchive does not write files into SRCS
+  # then we don't need this extra copying
+  #
+  # NOTE: We currently do not place restrictions on our limited export
+  # policy. This was not a typo. This means we are shipping the same file
+  # for both limited and unlimited US_export_policy.jar.  Only the local
+  # policy file currently has restrictions.
+  #
+  US_EXPORT_POLICY_JAR_SRC_DIR := \
+      $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
+  US_EXPORT_POLICY_JAR_TMP := \
+      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy_jar.tmp
+
+  $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
+	$(install-file)
+
+  US_EXPORT_POLICY_JAR_DEPS := \
+      $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+
+  $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
+      $(US_EXPORT_POLICY_JAR_DEPS), \
+      SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
+      SUFFIXES := .policy, \
+      JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \
+      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+      SKIP_METAINF := true))
+
+  $(US_EXPORT_POLICY_JAR_LIMITED): \
+      $(US_EXPORT_POLICY_JAR_UNLIMITED)
+		$(ECHO) $(LOG_INFO) \
+		    Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+		$(install-file)
+
+  TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED)
+endif
+
+ifeq ($(UNLIMITED_CRYPTO), true)
+  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED)
+	$(install-file)
+else
+  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED)
+	$(install-file)
+endif 
+
+ifndef OPENJDK
+  ifneq ($(UNLIMITED_CRYPTO), true)
+    $(UNLIMITED_POLICY_DIR)/US_export_policy.jar: \
+        $(US_EXPORT_POLICY_JAR_UNLIMITED)
+		$(install-file)
+    TARGETS += $(UNLIMITED_POLICY_DIR)/US_export_policy.jar
+  endif
+endif
+
+POLICY_JARS += $(US_EXPORT_POLICY_JAR_DST)
+
+################################################################################
+
+LOCAL_POLICY_JAR_DST := \
+    $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/local_policy.jar
+
+ifneq ($(BUILD_CRYPTO), no)
+
+  LOCAL_POLICY_JAR_LIMITED := \
+      $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy.jar
+  LOCAL_POLICY_JAR_UNLIMITED := \
+      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar
+
+  #
+  # TODO fix so that SetupArchive does not write files into SRCS
+  # then we don't need this extra copying
+  #
+  LOCAL_POLICY_JAR_LIMITED_TMP := \
+      $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy_jar.tmp
+  LOCAL_POLICY_JAR_UNLIMITED_TMP := \
+      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy_jar.tmp
+
+  $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
+      $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
+		$(install-file)
+
+  $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
+      $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
+		$(install-file)
+
+  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
+      $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
+      $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
+      SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
+      SUFFIXES := .policy, \
+      JAR := $(LOCAL_POLICY_JAR_LIMITED), \
+      EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
+      SKIP_METAINF := true))
+
+  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
+      $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
+      SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
+      SUFFIXES := .policy, \
+      JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
+      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+      SKIP_METAINF := true))
+
+  TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED)
+
+  ifndef OPENJDK
+    ifneq ($(UNLIMITED_CRYPTO), true)
+      $(UNLIMITED_POLICY_DIR)/README.txt: \
+          $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
+		$(install-file)
+
+      TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
+    endif
+  endif
+endif
+
+ifeq ($(UNLIMITED_CRYPTO), true)
+  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED)
+	$(install-file)
+else 
+  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED)
+	$(install-file)
+endif 
+
+ifndef OPENJDK
+  ifneq ($(UNLIMITED_CRYPTO), true)
+    $(UNLIMITED_POLICY_DIR)/local_policy.jar: \
+        $(LOCAL_POLICY_JAR_UNLIMITED)
+		$(install-file) 
+    TARGETS += $(UNLIMITED_POLICY_DIR)/local_policy.jar
+  endif
+endif
+
+POLICY_JARS += $(LOCAL_POLICY_JAR_DST)
+TARGETS += $(POLICY_JARS)
+
+################################################################################
+
--- a/jdk/make/gendata/GendataTZDB.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gendata/GendataTZDB.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -32,11 +32,11 @@
 TZDATA_TZFILE := africa antarctica asia australasia europe northamerica pacificnew southamerica backward etcetera gmt jdk11_backward
 TZDATA_TZFILES := $(addprefix $(TZDATA_DIR)/,$(TZDATA_TZFILE))
 
-GENDATA_TZDB_DAT := $(JDK_OUTPUTDIR)/lib/tzdb.dat
+GENDATA_TZDB_DAT := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/tzdb.dat
 
 $(GENDATA_TZDB_DAT): $(TZDATA_TZFILES)
 	$(RM) $(GENDATA_TZDB_DAT)
 	$(MKDIR) -p $(@D)
 	$(TOOL_TZDB) -srcdir $(TZDATA_DIR) -dstfile $(GENDATA_TZDB_DAT) $(TZDATA_TZFILE)
 
-GENDATA_TZDB += $(GENDATA_TZDB_DAT)
+TARGETS += $(GENDATA_TZDB_DAT)
--- a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -30,7 +30,7 @@
 # Generate files using the charsetmapping tool
 #
 CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
-CHARSET_GENSRC_JAVA_DIR_CS := $(JDK_OUTPUTDIR)/gensrc/jdk.charsets/sun/nio/cs/ext
+CHARSET_GENSRC_JAVA_DIR_CS := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.charsets/sun/nio/cs/ext
 CHARSET_DONE_CS := $(CHARSET_GENSRC_JAVA_DIR_CS)/_the.charsetmapping
 CHARSET_COPYRIGHT_HEADER := $(JDK_TOPDIR)/make/src/classes/build/tools/charsetmapping
 CHARSET_TEMPLATES := \
--- a/jdk/make/gensrc/Gensrc-jdk.dev.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/Gensrc-jdk.dev.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -31,7 +31,9 @@
 
 $(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, \
     $(filter %.properties, \
-        $(call CacheFind, $(JDK_TOPDIR)/src/jdk.dev/share/classes/sun/tools/jar/resources)), \
+        $(call CacheFind, \
+            $(JDK_TOPDIR)/src/jdk.dev/share/classes/jdk/tools/jimage/resources \
+            $(JDK_TOPDIR)/src/jdk.dev/share/classes/sun/tools/jar/resources)), \
     ListResourceBundle))
 
 TARGETS += $(COMPILE_PROPERTIES)
--- a/jdk/make/gensrc/Gensrc-jdk.jconsole.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/Gensrc-jdk.jconsole.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 ##########################################################################################
 # Version file for jconsole
 
-$(JDK_OUTPUTDIR)/gensrc/jdk.jconsole/sun/tools/jconsole/Version.java: \
+$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jconsole/sun/tools/jconsole/Version.java: \
     $(JDK_TOPDIR)/src/jdk.jconsole/share/classes/sun/tools/jconsole/Version.java.template
 	$(MKDIR) -p $(@D)
 	$(RM) $@ $@.tmp
@@ -36,7 +36,7 @@
 	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
 	$(MV) $@.tmp $@
 
-GENSRC_JDK_JCONSOLE += $(JDK_OUTPUTDIR)/gensrc/jdk.jconsole/sun/tools/jconsole/Version.java
+GENSRC_JDK_JCONSOLE += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jconsole/sun/tools/jconsole/Version.java
 
 jdk.jconsole: $(GENSRC_JDK_JCONSOLE)
 
--- a/jdk/make/gensrc/Gensrc-jdk.jdi.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/Gensrc-jdk.jdi.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -30,27 +30,34 @@
 # and a JDWPCommands.h C-header file.
 
 JDWP_SPEC_FILE := $(JDK_TOPDIR)/make/data/jdwp/jdwp.spec
+HEADER_FILE := $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
+JAVA_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java
 
-$(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h: $(JDWP_SPEC_FILE)
+# Both the header and java file are created using the same recipe. By declaring
+# this rule and adding header file to dependencies for java file, both are 
+# rebuilt if either is missing
+$(HEADER_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK)
 
-$(JDK_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java: \
-    $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK)
+# Touch the target of this rule at the end to avoid triggering false rebuilds
+$(JAVA_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) $(HEADER_FILE)
 	$(MKDIR) -p $(@D)
-	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_jdwp_headers
-	$(RM) $@ $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
+	$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent
+	$(RM) $@ $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
 	$(ECHO) $(LOG_INFO) Creating JDWP.java and JDWPCommands.h from jdwp.spec
-	$(TOOL_JDWPGEN) $< -jdi $@ -include $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
+	$(TOOL_JDWPGEN) $< -jdi $@ -include \
+	    $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
+	$(TOUCH) $@
 
-$(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html: $(JDWP_SPEC_FILE) \
+$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html: $(JDWP_SPEC_FILE) \
     $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(ECHO) $(LOG_INFO) Creating $(@F) from jdwp.spec
 	$(TOOL_JDWPGEN) $< -doc $@
 
-GENSRC_JDWP := $(JDK_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java \
-    $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h \
-    $(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html
+GENSRC_JDWP := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java \
+    $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h \
+    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
 GENSRC_JDK_JDI += $(GENSRC_JDWP)
 
 ################################################################################
@@ -61,11 +68,18 @@
 endef
 
 # Filter com.sun.jdi.connect.Connector
-$(JDK_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \
-    $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector
+$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \
+    $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector \
+    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
 	$(process-provider)
 
-GENSRC_JDK_JDI += $(JDK_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector
+# Copy the same service file into jdk.hotspot.agent so that they are kept the same.
+$(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector: \
+    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector
+	$(install-file)
+
+GENSRC_JDK_JDI += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector \
+    $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector
 
 ################################################################################
 
--- a/jdk/make/gensrc/GensrcBuffer.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcBuffer.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,7 @@
 
 GENSRC_BUFFER := 
 
-GENSRC_BUFFER_TMP := $(JDK_OUTPUTDIR)/gensrc
-GENSRC_BUFFER_DST := $(JDK_OUTPUTDIR)/gensrc/java.base/java/nio
+GENSRC_BUFFER_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/nio
 
 GENSRC_BUFFER_SRC := $(JDK_TOPDIR)/src/java.base/share/classes/java/nio
 
--- a/jdk/make/gensrc/GensrcCLDR.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcCLDR.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 CLDRVERSION := 21.0.1
 CLDRSRCDIR := $(JDK_TOPDIR)/src/jdk.localedata/share/classes/sun/util/cldr/resources/$(subst .,_,$(CLDRVERSION))
 
-GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc/jdk.localedata
+GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata
 
 CLDR_METAINFO_FILE := $(GENSRC_DIR)/sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.java
 
--- a/jdk/make/gensrc/GensrcCharacterData.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcCharacterData.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 #
 
 #
-# Rules to create $(JDK_OUTPUTDIR)/gensrc/sun/lang/CharacterData*.java
+# Rules to create $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/lang/CharacterData*.java
 #
 
 GENSRC_CHARACTERDATA :=
@@ -33,7 +33,8 @@
 UNICODEDATA = $(JDK_TOPDIR)/make/data/unicodedata
 
 define SetupCharacterData
-  $(JDK_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java: $(CHARACTERDATA)/$1.java.template $(BUILD_TOOLS_JDK)
+  $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java: \
+      $(CHARACTERDATA)/$1.java.template
 	$(MKDIR) -p $$(@D)
 	$(ECHO) $(LOG_INFO) Generating $1.java
 	$(TOOL_GENERATECHARACTER) $2 \
@@ -41,10 +42,10 @@
 	    -spec $(UNICODEDATA)/UnicodeData.txt \
 	    -specialcasing $(UNICODEDATA)/SpecialCasing.txt \
 	    -proplist $(UNICODEDATA)/PropList.txt \
-	    -o $(JDK_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java -string \
+	    -o $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java -string \
 	    -usecharforbyte $3
 
-  GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java
+  GENSRC_CHARACTERDATA += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java
 endef
 
 $(eval $(call SetupCharacterData,CharacterDataLatin1, , -latin1 8))
@@ -54,12 +55,12 @@
 $(eval $(call SetupCharacterData,CharacterData0E, -plane 14, 11 4 1))
 
 # Copy two Java files that need no preprocessing.
-$(JDK_OUTPUTDIR)/gensrc/java.base/java/lang/%.java: $(CHARACTERDATA)/%.java.template
+$(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/%.java: $(CHARACTERDATA)/%.java.template
 	$(ECHO) $(LOG_INFO) Generating $(@F)
 	$(call install-file)
 
-GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataUndefined.java \
-    $(JDK_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataPrivateUse.java
+GENSRC_CHARACTERDATA += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataUndefined.java \
+    $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataPrivateUse.java
 GENSRC_JAVA_BASE += $(GENSRC_CHARACTERDATA)
 
 $(GENSRC_CHARACTERDATA): $(BUILD_TOOLS_JDK)
--- a/jdk/make/gensrc/GensrcCharsetCoder.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcCharsetCoder.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,13 @@
 
 GENSRC_CHARSETCODER :=
 
-GENSRC_CHARSETCODER_TMP := $(JDK_OUTPUTDIR)/gensrc
-GENSRC_CHARSETCODER_DST := $(JDK_OUTPUTDIR)/gensrc/java.base/java/nio/charset
+GENSRC_CHARSETCODER_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/nio/charset
 
 GENSRC_CHARSETCODER_SRC := $(JDK_TOPDIR)/src/java.base/share/classes/java/nio
 
 GENSRC_CHARSETCODER_TEMPLATE := $(GENSRC_CHARSETCODER_SRC)/charset/Charset-X-Coder.java.template
 
-###
+################################################################################
 
 $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
 	$(MKDIR) -p $(@D)
@@ -67,7 +66,7 @@
 
 GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java
 
-###
+################################################################################
 
 $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
 	$(MKDIR) -p $(@D)
@@ -103,6 +102,6 @@
 GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java
 GENSRC_JAVA_BASE += $(GENSRC_CHARSETCODER)
 
-###
+################################################################################
 
 $(GENSRC_CHARSETCODER): $(BUILD_TOOLS_JDK)
--- a/jdk/make/gensrc/GensrcCharsetMapping.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcCharsetMapping.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -28,7 +28,7 @@
 # Generate files using the charsetmapping tool
 #
 CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
-CHARSET_GENSRC_JAVA_DIR_BASE := $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/cs
+CHARSET_GENSRC_JAVA_DIR_BASE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/cs
 CHARSET_DONE_BASE := $(CHARSET_GENSRC_JAVA_DIR_BASE)/_the.charsetmapping
 CHARSET_TEMPLATES := \
     $(CHARSET_DATA_DIR)/SingleByte-X.java.template \
@@ -46,7 +46,7 @@
 #
 # Generate the sun/nio/cs/StandardCharsets.java file
 #
-CHARSET_STANDARD_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc/standardcharsets
+CHARSET_STANDARD_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_standardcharsets
 CHARSET_STANDARD_DATA := $(CHARSET_DATA_DIR)/standard-charsets
 CHARSET_STANDARD_JAVA :=  sun/nio/cs/StandardCharsets.java
 
@@ -118,7 +118,7 @@
 
 $(eval $(call SetupTextFileProcessing, BUILD_CHARSET_STANDARD, \
     SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/$(CHARSET_STANDARD_JAVA).template, \
-    OUTPUT_FILE := $(JDK_OUTPUTDIR)/gensrc/java.base/$(CHARSET_STANDARD_JAVA), \
+    OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/$(CHARSET_STANDARD_JAVA), \
     INCLUDES := \
         _INCLUDE_ALIASES_TABLES_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet ; \
         _INCLUDE_ALIASES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet ; \
--- a/jdk/make/gensrc/GensrcExceptions.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcExceptions.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,7 @@
 
 GENSRC_EXCEPTIONS :=
 
-GENSRC_EXCEPTIONS_TMP := $(JDK_OUTPUTDIR)/gensrc
-GENSRC_EXCEPTIONS_DST := $(JDK_OUTPUTDIR)/gensrc/java.base/java/nio
+GENSRC_EXCEPTIONS_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/nio
 
 GENSRC_EXCEPTIONS_SRC := $(JDK_TOPDIR)/src/java.base/share/classes/java/nio
 GENSRC_EXCEPTIONS_CMD := $(JDK_TOPDIR)/make/scripts/genExceptions.sh
--- a/jdk/make/gensrc/GensrcIcons.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcIcons.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 GENSRC_AWT_ICONS :=
 GENSRC_AWT_ICONS_SRC :=
-GENSRC_AWT_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc
-GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/java.desktop/sun/awt/
+GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop
+GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/
 
 ifdef OPENJDK
   X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)
@@ -62,14 +62,14 @@
 GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
 GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
 
-###
+################################################################################
 
 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
 	$(ECHO) Generating icon classes
 	$(MKDIR) -p $(GENSRC_AWT_ICONS_DST)
 	$(TOUCH) $@
 
-###
+################################################################################
 
 define SetupGensrcAWTIcon
   # param 1 is for src-file
@@ -107,11 +107,11 @@
 
 GENSRC_JAVA_DESKTOP += $(GENSRC_AWT_ICONS)
 
-###
+################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
-  GENSRC_OSX_ICONS_DST := $(JDK_OUTPUTDIR)/gensrc_headers_icons
+  GENSRC_OSX_ICONS_DST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop
   GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
 
   ifdef OPENJDK
--- a/jdk/make/gensrc/GensrcLocaleData.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcLocaleData.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -42,14 +42,14 @@
 LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
 
 # Include the list of resources found during the previous compile.
--include $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources
+-include $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_the.locale_resources
 
 MISSING_RESOURCES := $(filter-out $(LOCALE_RESOURCES), $(PREV_LOCALE_RESOURCES))
 NEW_RESOURCES := $(filter-out $(PREV_LOCALE_RESOURCES), $(LOCALE_RESOURCES))
 
 ifneq (, $(MISSING_RESOURCES)$(NEW_RESOURCES))
   # There is a difference in the number of supported resources. Trigger a regeneration.
-  $(shell $(RM) $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java)
+  $(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/LocaleDataMetaInfo.java)
 endif
 
 # The EN locales
@@ -116,26 +116,28 @@
 SED_ENARGS += -e 's/$(HASH)AvailableLocales_Locales$(HASH)/$(sort $(ALL_EN_LOCALES))/g'
 SED_NONENARGS += -e 's/$(HASH)AvailableLocales_Locales$(HASH)/$(sort $(ALL_NON_EN_LOCALES))/g'
 
-$(JDK_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/EnLocaleDataMetaInfo.java: \
+$(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/EnLocaleDataMetaInfo.java: \
     $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
 	$(MKDIR) -p $(@D)
 	$(ECHO) Creating sun/util/locale/provider/EnLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
-	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources
+	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" \
+	    > $(SUPPORT_OUTPUTDIR)/gensrc/_the.locale_resources
 	$(SED) $(SED_ENARGS) $< > $@
 
-$(JDK_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonEnLocaleDataMetaInfo.java: \
+$(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonEnLocaleDataMetaInfo.java: \
     $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
 	$(MKDIR) -p $(@D)
 	$(ECHO) Creating sun/util/resources/provider/NonEnLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
-	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources
+	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" \
+	    > $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/_the.locale_resources
 	$(SED) $(SED_NONENARGS) $< > $@
 
-GENSRC_BASELOCALEDATA := $(JDK_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/EnLocaleDataMetaInfo.java
-GENSRC_LOCALEDATA := $(JDK_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonEnLocaleDataMetaInfo.java
+GENSRC_BASELOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/EnLocaleDataMetaInfo.java
+GENSRC_LOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonEnLocaleDataMetaInfo.java
 
 ################################################################################
 
-GENSRC_CRBC_DST := $(JDK_OUTPUTDIR)/gensrc/java.base/sun/util/CoreResourceBundleControl.java
+GENSRC_CRBC_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/CoreResourceBundleControl.java
 GENSRC_CRBC_CMD := $(JDK_TOPDIR)/make/scripts/localelist.sh
 
 JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
--- a/jdk/make/gensrc/GensrcMisc.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcMisc.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,37 +23,32 @@
 # questions.
 #
 
-include ProfileNames.gmk
-
 ##########################################################################################
 # Install the launcher name, release version string, full version
 # string and the runtime name into the Version.java file.
 # To be printed by java -version
 
-$(JDK_OUTPUTDIR)/gensrc/java.base/sun/misc/Version.java \
-$(PROFILE_VERSION_JAVA_TARGETS): \
+$(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/misc/Version.java: \
     $(JDK_TOPDIR)/src/java.base/share/classes/sun/misc/Version.java.template
 	$(MKDIR) -p $(@D)
 	$(RM) $@ $@.tmp
-	$(ECHO) Generating sun/misc/Version.java $(call profile_version_name, $@)
+	$(ECHO) Generating sun/misc/Version.java
 	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
 	    -e 's/@@java_version@@/$(RELEASE)/g' \
 	    -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
 	    -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
-	    -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \
 	    $< > $@.tmp
 	$(MV) $@.tmp $@
 
-GENSRC_JAVA_BASE += $(JDK_OUTPUTDIR)/gensrc/java.base/sun/misc/Version.java \
-    $(PROFILE_VERSION_JAVA_TARGETS)
+GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/misc/Version.java
 
 ##########################################################################################
 
-GENSRC_JAVA_BASE += $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java
+GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java
 
 GENSRC_SOR_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/ch
 GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
-GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/btnative/genSocketOptionRegistry
+GENSRC_SOR_BIN := $(BUILDTOOLS_OUTPUTDIR)/native/genSocketOptionRegistry
 
 SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
     $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
@@ -71,14 +66,15 @@
 SOR_PREGEN_FILE := $(JDK_TOPDIR)/src/closed/java.base/$(OPENJDK_TARGET_OS)/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template
 
 ifeq ($(wildcard $(SOR_PREGEN_FILE)), )
-  $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE)
+  $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE)
 	$(MKDIR) -p $(@D)
 	$(RM) $@ $@.tmp
-	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e \
+	    $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
 	$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
 	$(MV) $@.tmp $@
 else
-  $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java: $(SOR_PREGEN_FILE)
+  $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java: $(SOR_PREGEN_FILE)
 	$(call install-file)
 endif
 
@@ -86,11 +82,11 @@
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
 
-  GENSRC_JAVA_BASE += $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java
+  GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java
 
   GENSRC_UC_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/fs
   GENSRC_UC_SRC_FILE := genUnixConstants.c
-  GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/btnative/genUnixConstants
+  GENSRC_UC_BIN := $(BUILDTOOLS_OUTPUTDIR)/native/genUnixConstants
 
   UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
@@ -109,14 +105,15 @@
   UC_PREGEN_FILE := $(JDK_TOPDIR)/src/closed/java.base/$(OPENJDK_TARGET_OS)/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template
 
   ifeq ($(wildcard $(UC_PREGEN_FILE)), )
-    $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java: $(BUILD_GENSRC_UC_EXE)
+    $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java: $(BUILD_GENSRC_UC_EXE)
 	$(MKDIR) -p $(@D)
 	$(RM) $@ $@.tmp
-	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e \
+	    $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
 	$(BUILD_GENSRC_UC_EXE) >> $@.tmp
 	$(MV) $@.tmp $@
   else
-    $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java: $(UC_PREGEN_FILE)
+    $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java: $(UC_PREGEN_FILE)
 	$(call install-file)
   endif
 
@@ -126,11 +123,11 @@
 
 ifeq ($(OPENJDK_TARGET_OS), solaris)
 
-  GENSRC_JAVA_BASE += $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/SolarisConstants.java
+  GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/SolarisConstants.java
 
   GENSRC_SOL_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/fs
   GENSRC_SOL_SRC_FILE := genSolarisConstants.c
-  GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/btnative/genSolarisConstants
+  GENSRC_SOL_BIN := $(BUILDTOOLS_OUTPUTDIR)/native/genSolarisConstants
 
   SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
@@ -145,10 +142,11 @@
       OUTPUT_DIR := $(GENSRC_SOL_BIN), \
       PROGRAM := genSolarisConstants))
 
-  $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/SolarisConstants.java: $(BUILD_GENSRC_SOL_EXE)
+  $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/SolarisConstants.java: $(BUILD_GENSRC_SOL_EXE)
 	$(MKDIR) -p $(@D)
 	$(RM) $@ $@.tmp
-	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e \
+	    $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
 	$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
 	$(MV) $@.tmp $@
 
--- a/jdk/make/gensrc/GensrcProperties.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcProperties.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 # Helper macro for SetupCopy-zh_HK.
 define SetupOneCopy-zh_HK
   $1_$2_TARGET := $$(patsubst $(JDK_TOPDIR)/src/$(MODULE)/share/classes/%, \
-      $(JDK_OUTPUTDIR)/gensrc/$(MODULE)/%, \
+      $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/%, \
       $$(subst _zh_TW,_zh_HK, $2))
 
   $$($1_$2_TARGET): $2
@@ -62,7 +62,7 @@
   # Strip away prefix and suffix, leaving for example only: 
   # "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
   $1_JAVAS := $$(patsubst $(JDK_TOPDIR)/src/%, \
-      $(JDK_OUTPUTDIR)/gensrc/%, \
+      $(SUPPORT_OUTPUTDIR)/gensrc/%, \
       $$(patsubst %.properties, %.java, \
       $$(subst /share/classes,, $$($1_SRCS))))
 
@@ -78,10 +78,10 @@
       $$(addsuffix _SPACE_$$($1_CLASS), \
       $$(addprefix _SPACE_, $$($1_JAVAS)))))
 
-  $1_TARGET := $(JDK_OUTPUTDIR)/gensrc/$(MODULE)/_the.$1.done
-  $1_CMDLINE_FILE := $(JDK_OUTPUTDIR)/gensrc/$(MODULE)/_the.$1.cmdline
+  $1_TARGET := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the.$1.done
+  $1_CMDLINE_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the.$1.cmdline
 
-  # Now setup the rule for the generation of the resource bundles.
+# Now setup the rule for the generation of the resource bundles.
   $$($1_TARGET): $$($1_SRCS) $$($1_JAVAS) $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $$(@D) $$($1_DIRS)
 	$(ECHO) Compiling $$(words $$($1_SRCS)) properties into resource bundles for $(MODULE)
--- a/jdk/make/gensrc/GensrcSwing.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcSwing.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,25 +27,26 @@
 # Generate java files for javax.swing.plaf package
 #
 NIMBUS_PACKAGE = javax.swing.plaf
-NIMBUS_GENSRC_DIR = $(JDK_OUTPUTDIR)/gensrc/java.desktop/javax/swing/plaf/nimbus
+NIMBUS_GENSRC_DIR = $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/javax/swing/plaf/nimbus
 NIMBUS_SKIN_FILE = $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/skin.laf
 
-$(JDK_OUTPUTDIR)/gensrc/_the.generated_nimbus: $(NIMBUS_SKIN_FILE) $(BUILD_TOOLS_JDK)
+$(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus: $(NIMBUS_SKIN_FILE) $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $(@D)
 	$(ECHO) "Generating Nimbus source files"
 	$(TOOL_GENERATENIMBUS) $(LOG_INFO) \
-	    -skinFile $(NIMBUS_SKIN_FILE) -buildDir $(JDK_OUTPUTDIR)/gensrc/java.desktop \
+	    -skinFile $(NIMBUS_SKIN_FILE) -buildDir $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop \
 	    -packagePrefix $(NIMBUS_PACKAGE).nimbus -lafName Nimbus
 	$(ECHO) $(LOG_INFO) "Finished generating Nimbus source files"
 	$(TOUCH) $@
 
-GENSRC_SWING_NIMBUS := $(JDK_OUTPUTDIR)/gensrc/_the.generated_nimbus
+GENSRC_SWING_NIMBUS := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus
 
 #
 # Generate beaninfo java files
 #
 
-DOCLET_DATA_DIR = $(JDK_TOPDIR)/make/data/swingbeaninfo
+BEANINFO_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/gensrc_no_docs/java.desktop
+DOCLET_DATA_DIR := $(JDK_TOPDIR)/make/data/swingbeaninfo
 
 # javax.swing package
 BEANS = AbstractButton Box JComponent JApplet JButton \
@@ -67,41 +68,44 @@
 
 # Dummy variable so far, in the old build system it was false by default
 SWINGBEAN_DEBUG_FLAG = false
-# GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(JDK_OUTPUTDIR)/btclasses
+# GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes
 # LocaleDataMetaInfo needs to be generated before running this to avoid confusing errors
 # in the build log.
-$(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) \
-    $(JDK_OUTPUTDIR)/gensrc_no_srczip/java.desktop/javax/swing/SwingBeanInfoBase.java \
-    $(JDK_OUTPUTDIR)/gensrc/java.desktop/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS_JDK) \
-    | $(GENSRC_LOCALEDATAMETAINFO)
+$(BEANINFO_OUTPUTDIR)/_the.generated_beaninfo: $(BEANS_SRC) \
+    $(BEANINFO_OUTPUTDIR)/javax/swing/SwingBeanInfoBase.java \
+    $(BEANINFO_OUTPUTDIR)/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS_JDK)
 	$(ECHO) Generating beaninfo
-	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/java.desktop/javax/swing
+	$(MKDIR) -p $(BEANINFO_OUTPUTDIR)/javax/swing
 	$(JAVA) -Djava.awt.headless=true $(NEW_JAVADOC) \
 	    -sourcepath "$(subst $(SPACE),$(PATH_SEP),\
 	        $(wildcard $(JDK_TOPDIR)/src/*/*/classes) \
-	        $(JDK_OUTPUTDIR)/gensrc/java.base)" \
+	        $(SUPPORT_OUTPUTDIR)/gensrc/java.base)" \
 	    -doclet build.tools.swingbeaninfo.GenDocletBeanInfo \
-	    -x $(SWINGBEAN_DEBUG_FLAG) -d $(JDK_OUTPUTDIR)/gensrc_no_srczip/java.desktop/javax/swing \
-	    -t $(DOCLET_DATA_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
+	    -x $(SWINGBEAN_DEBUG_FLAG) -d $(BEANINFO_OUTPUTDIR)/javax/swing \
+	    -t $(DOCLET_DATA_DIR)/SwingBeanInfo.template \
+	    -docletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
 	    -XDignore.symbol.file=true \
-	    -classpath $(JDK_OUTPUTDIR)/btclasses $(BEANS_SRC) $(LOG_INFO)
+	    -classpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes $(BEANS_SRC) $(LOG_INFO)
         # Move the JTextComponent into its proper package directory.
-	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/java.desktop/javax/swing/text
-	$(MV) $(JDK_OUTPUTDIR)/gensrc_no_srczip/java.desktop/javax/swing/JTextComponentBeanInfo.java $(JDK_OUTPUTDIR)/gensrc_no_srczip/java.desktop/javax/swing/text/JTextComponentBeanInfo.java
+	$(MKDIR) -p $(BEANINFO_OUTPUTDIR)/javax/swing/text
+	$(MV) $(BEANINFO_OUTPUTDIR)/javax/swing/JTextComponentBeanInfo.java \
+	    $(BEANINFO_OUTPUTDIR)/javax/swing/text/JTextComponentBeanInfo.java
 	$(TOUCH) $@
 
 # This file is the part of dt.jar
 # For some reason it is under $(JDK_TOPDIR)/make/data/swingbeaninfo
 # Should it be moved under $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing instead?
-$(JDK_OUTPUTDIR)/gensrc_no_srczip/java.desktop/javax/swing/SwingBeanInfoBase.java: $(DOCLET_DATA_DIR)/javax/swing/SwingBeanInfoBase.java
+$(BEANINFO_OUTPUTDIR)/javax/swing/SwingBeanInfoBase.java: \
+    $(DOCLET_DATA_DIR)/javax/swing/SwingBeanInfoBase.java
 	$(call install-file)
 
 # This file is the part of dt.jar
 # For some reason it is under $(JDK_TOPDIR)/make/data/swingbeaninfo
 # Should it be moved under $(JDK_TOPDIR)/src/java.desktop/share/classes/sun/swing instead?
-$(JDK_OUTPUTDIR)/gensrc/java.desktop/sun/swing/BeanInfoUtils.java: $(DOCLET_DATA_DIR)/sun/swing/BeanInfoUtils.java
+$(BEANINFO_OUTPUTDIR)/sun/swing/BeanInfoUtils.java: \
+    $(DOCLET_DATA_DIR)/sun/swing/BeanInfoUtils.java
 	$(call install-file)
 
-GENSRC_SWING_BEANINFO = $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo
+GENSRC_SWING_BEANINFO = $(BEANINFO_OUTPUTDIR)/_the.generated_beaninfo
 
 GENSRC_JAVA_DESKTOP += $(GENSRC_SWING_BEANINFO) $(GENSRC_SWING_NIMBUS)
--- a/jdk/make/gensrc/GensrcX11Wrappers.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/gensrc/GensrcX11Wrappers.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,9 +37,9 @@
 GENSRC_X11WRAPPERS :=
 # Put temporary c-code and executable to calculate offsets here.
 # Also put verification offset file here as well.
-GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers
+GENSRC_X11WRAPPERS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_x11wrappers
 # Put the generated Java classes used to interface X11 from awt here.
-GENSRC_X11WRAPPERS_DST := $(JDK_OUTPUTDIR)/gensrc/java.desktop/sun/awt/X11
+GENSRC_X11WRAPPERS_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/sun/awt/X11
 
 # The pre-calculated offset file are stored here:
 GENSRC_SIZER_DIR := $(JDK_TOPDIR)/make/data/x11wrappergen
@@ -69,12 +69,12 @@
 
 # Run the tool on the offset files copied from the source repository to generate several Java classes
 # used in awt.
-$(JDK_OUTPUTDIR)/gensrc/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS_JDK)
+$(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $(GENSRC_X11WRAPPERS_DST)
 	$(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes
 	$(TOUCH) $@
 
-GENSRC_X11WRAPPERS += $(JDK_OUTPUTDIR)/gensrc/_the.generated.x11
+GENSRC_X11WRAPPERS += $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11
 
 ifneq ($(COMPILE_TYPE), cross)
   # This is not a cross compile, regenerate the offset file, so that we
@@ -91,7 +91,7 @@
     MEMORY_MODEL_FLAG="$(COMPILER_TARGET_BITS_FLAG)$*"
   endif
 
-  SIZER_CFLAGS := -I$(JDK_OUTPUTDIR)/include \
+  SIZER_CFLAGS := \
       -I$(JDK_TOPDIR)/src/java.base/share/native/include \
       -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include \
       -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
--- a/jdk/make/launcher/Launcher-java.base.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-java.base.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -32,20 +32,20 @@
 # overwritten.
 $(eval $(call SetupLauncher,java, \
     -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib, \
-    $(JDK_OUTPUTDIR)/objs/jli_static.lib, $(JAVA_RC_FLAGS), \
-    $(JAVA_VERSION_INFO_RESOURCE), $(JDK_OUTPUTDIR)/objs/java_objs,true))
+    $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jli_static.lib, $(JAVA_RC_FLAGS), \
+    $(JAVA_VERSION_INFO_RESOURCE), $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/java_objs,true))
 
-$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
+$(SUPPORT_OUTPUTDIR)/modules_cmds/java.base/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
-	$(CP) $(JDK_OUTPUTDIR)/objs/java_objs$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX) $@
+	$(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/java_objs$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX) $@
 
-LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX)
+TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/java.base/java$(EXE_SUFFIX)
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   $(eval $(call SetupLauncher,javaw, \
       -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib, \
-      $(JDK_OUTPUTDIR)/objs/jli_static.lib, $(JAVA_RC_FLAGS), \
+      $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jli_static.lib, $(JAVA_RC_FLAGS), \
       $(JAVA_VERSION_INFO_RESOURCE),,true))
 endif
 
@@ -57,7 +57,7 @@
 BUILD_JEXEC :=
 BUILD_JEXEC_SRC :=
 BUILD_JEXEC_INC :=
-BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
+BUILD_JEXEC_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
 
 #
 # UNHANDLED:
@@ -90,7 +90,7 @@
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), linux)
-    BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
+    BUILD_JEXEC_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
     BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/java.base/share/native/libjli
   endif
 endif
@@ -111,12 +111,12 @@
       CFLAGS_solaris := -KPIC, \
       LDFLAGS := $(LDFLAGS_JDKEXE) \
           $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/jexec_obj, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \
       OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \
       DEBUG_SYMBOLS := true, \
       PROGRAM := jexec))
 
-  LIBRARIES += $(BUILD_JEXEC)
+  TARGETS += $(BUILD_JEXEC)
 endif
 
 ################################################################################
@@ -124,8 +124,8 @@
 BUILD_JSPAWNHELPER :=
 BUILD_JSPAWNHELPER_SRC := $(JDK_TOPDIR)/src/java.base/unix/native/jspawnhelper
 JSPAWNHELPER_CFLAGS := -I$(JDK_TOPDIR)/src/java.base/unix/native/libjava
-BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
-LINK_JSPAWNHELPER_OBJECTS := $(JDK_OUTPUTDIR)/objs/libjava/childproc.o
+BUILD_JSPAWNHELPER_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
+LINK_JSPAWNHELPER_OBJECTS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc.o
 LINK_JSPAWNHELPER_FLAGS :=
 
 ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix), )
@@ -133,7 +133,7 @@
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib
+  BUILD_JSPAWNHELPER_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
 endif
 
 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
@@ -149,19 +149,13 @@
       CFLAGS := $(CFLAGS_JDKEXE) $(JSPAWNHELPER_CFLAGS), \
       LDFLAGS := $(LDFLAGS_JDKEXE) $(LINK_JSPAWNHELPER_FLAGS), \
       LDFLAGS_SUFFIX := $(LINK_JSPAWNHELPER_OBJECTS), \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/jspawnhelper, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jspawnhelper, \
       OUTPUT_DIR := $(BUILD_JSPAWNHELPER_DST_DIR), \
       PROGRAM := jspawnhelper))
 
   $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS)
 
-  LIBRARIES += $(BUILD_JSPAWNHELPER)
+  TARGETS += $(BUILD_JSPAWNHELPER)
 endif
 
 ################################################################################
-
-java.base: $(LAUNCHERS) $(LIBRARIES)
-
-all: java.base
-
-.PHONY: all java.base
--- a/jdk/make/launcher/Launcher-java.corba.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-java.corba.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -45,9 +45,3 @@
         "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
         "com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }'))
 
-
-java.corba: $(LAUNCHERS)
-
-all: java.corba
-
-.PHONY: all java.corba
--- a/jdk/make/launcher/Launcher-java.desktop.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-java.desktop.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -34,8 +34,3 @@
       $(XLIBS)))
 endif
 
-java.desktop: $(LAUNCHERS)
-
-all: java.desktop
-
-.PHONY: all java.desktop
--- a/jdk/make/launcher/Launcher-java.rmi.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-java.rmi.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -36,12 +36,12 @@
 #
 # The java-rmi.cgi script in bin/ only gets delivered in certain situations
 #
-JAVA_RMI_CGI := $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java-rmi.cgi
+JAVA_RMI_CGI := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/java-rmi.cgi
 ifeq ($(OPENJDK_TARGET_OS), linux)
-  LAUNCHERS += $(JAVA_RMI_CGI)
+  TARGETS += $(JAVA_RMI_CGI)
 endif
 ifeq ($(OPENJDK_TARGET_OS), solaris)
-  LAUNCHERS += $(JAVA_RMI_CGI)
+  TARGETS += $(JAVA_RMI_CGI)
 endif
 
 # TODO:
@@ -61,9 +61,3 @@
 endif
 
 ##########################################################################################
-
-java.rmi: $(LAUNCHERS)
-
-all: java.rmi
-
-.PHONY: all java.rmi
--- a/jdk/make/launcher/Launcher-java.scripting.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-java.scripting.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -28,8 +28,3 @@
 $(eval $(call SetupLauncher,jrunscript, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.script.shell.Main"$(COMMA) }'))
 
-java.scripting: $(LAUNCHERS)
-
-all: java.scripting
-
-.PHONY: all java.scripting
--- a/jdk/make/launcher/Launcher-java.security.jgss.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-java.security.jgss.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -36,8 +36,3 @@
       -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }'))
 endif
 
-java.security.jgss: $(LAUNCHERS)
-
-all: java.security.jgss
-
-.PHONY: all java.security.jgss
--- a/jdk/make/launcher/Launcher-jdk.compiler.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.compiler.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -30,13 +30,6 @@
     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }'))
 
-ifeq ($(ENABLE_SJAVAC), yes)
-  $(eval $(call SetupLauncher,sjavac, \
-      -DEXPAND_CLASSPATH_WILDCARDS \
-      -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
-      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.sjavac.Main"$(COMMA) }'))
-endif
-
 $(eval $(call SetupLauncher,javah, \
     -DEXPAND_CLASSPATH_WILDCARDS \
     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
@@ -51,8 +44,12 @@
     -DEXPAND_CLASSPATH_WILDCARDS \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))
 
-jdk.compiler: $(LAUNCHERS)
-
-all: jdk.compiler
-
-.PHONY: all jdk.compiler
+ifeq ($(ENABLE_SJAVAC), yes)
+  # Build sjavac directly to the exploded image so that it does not get included
+  # into any real images
+  $(eval $(call SetupLauncher,sjavac, \
+      -DEXPAND_CLASSPATH_WILDCARDS \
+      -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
+      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.sjavac.Main"$(COMMA) }',,,,,,, \
+      $(JDK_OUTPUTDIR)/bin))
+endif
--- a/jdk/make/launcher/Launcher-jdk.dev.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.dev.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -36,14 +36,12 @@
     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))
 
+$(eval $(call SetupLauncher,jimage,\
+    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.tools.jimage.Main"$(COMMA) }'))
+
 $(eval $(call SetupLauncher,jhat, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.hat.Main"$(COMMA) }'))
 
 $(eval $(call SetupLauncher,native2ascii, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))
 
-jdk.dev: $(LAUNCHERS)
-
-all: jdk.dev
-
-.PHONY: all jdk.dev
--- a/jdk/make/launcher/Launcher-jdk.hotspot.agent.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.hotspot.agent.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -30,8 +30,3 @@
     -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
     ,,,,,,,,,Info-privileged.plist))
 
-jdk.hotspot.agent: $(LAUNCHERS)
-
-all: jdk.hotspot.agent
-
-.PHONY: all jdk.hotspot.agent
--- a/jdk/make/launcher/Launcher-jdk.javadoc.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.javadoc.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -30,8 +30,3 @@
     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javadoc.Main"$(COMMA) }'))
 
-jdk.javadoc: $(LAUNCHERS)
-
-all: jdk.javadoc
-
-.PHONY: all jdk.javadoc
--- a/jdk/make/launcher/Launcher-jdk.jcmd.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.jcmd.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -58,8 +58,3 @@
 $(eval $(call SetupLauncher,jcmd, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
 
-jdk.jcmd: $(LAUNCHERS)
-
-all: jdk.jcmd
-
-.PHONY: all jdk.jcmd
--- a/jdk/make/launcher/Launcher-jdk.jconsole.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.jconsole.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -32,8 +32,3 @@
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "-J-Djconsole.showOutputViewer"$(COMMA) "sun.tools.jconsole.JConsole"$(COMMA) }' \
     -DAPP_CLASSPATH='{ "/lib/jconsole.jar"$(COMMA) "/lib/tools.jar"$(COMMA) "/classes" }'))
 
-jdk.jconsole: $(LAUNCHERS)
-
-all: jdk.jconsole
-
-.PHONY: all jdk.jconsole
--- a/jdk/make/launcher/Launcher-jdk.jdi.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.jdi.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -29,8 +29,3 @@
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.example.debug.tty.TTY"$(COMMA) }' \
     -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))
 
-jdk.jdi: $(LAUNCHERS)
-
-all: jdk.jdi
-
-.PHONY: all jdk.jdi
--- a/jdk/make/launcher/Launcher-jdk.jvmstat.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.jvmstat.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -28,8 +28,3 @@
 $(eval $(call SetupLauncher,jstatd, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }'))
 
-jdk.jvmstat: $(LAUNCHERS)
-
-all: jdk.jvmstat
-
-.PHONY: all jdk.jvmstat
--- a/jdk/make/launcher/Launcher-jdk.rmic.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.rmic.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -29,8 +29,3 @@
     -DEXPAND_CLASSPATH_WILDCARDS \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.rmic.Main"$(COMMA) }'))
 
-jdk.rmic: $(LAUNCHERS)
-
-all: jdk.rmic
-
-.PHONY: all jdk.rmic
--- a/jdk/make/launcher/Launcher-jdk.runtime.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.runtime.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -49,16 +49,16 @@
   UNPACKEXE_ZIPOBJS := -lz
 else
   UNPACKEXE_CFLAGS += -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
-  UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
-      $(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
+  UNPACKEXE_ZIPOBJS := $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zcrc32$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/deflate$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/trees$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zadler32$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/compress$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zutil$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inflate$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/infback$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inftrees$(OBJ_SUFFIX) \
+      $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/inffast$(OBJ_SUFFIX)
 
 endif
 
@@ -108,8 +108,8 @@
     LDFLAGS_linux := -lc, \
     LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
     LDFLAGS_SUFFIX := $(LIBCXX), \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
-    OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
+    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
+    OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
     PROGRAM := unpack200, \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
     RC_FLAGS := $(RC_FLAGS) \
@@ -133,15 +133,9 @@
 # image. The real fix would be clean up linking of unpack200 using
 # -link -incremental:no
 # like all other launchers.
-$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
+$(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
 	$(call install-file)
 
-LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX)
+TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX)
 
 ################################################################################
-
-jdk.runtime: $(LAUNCHERS)
-
-all: jdk.runtime
-
-.PHONY: all jdk.runtime
--- a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -28,8 +28,3 @@
 $(eval $(call SetupLauncher,jjs, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.nashorn.tools.Shell"$(COMMA) }'))
 
-jdk.scripting.nashorn: $(LAUNCHERS)
-
-all: jdk.scripting.nashorn
-
-.PHONY: all jdk.scripting.nashorn
--- a/jdk/make/launcher/Launcher-jdk.xml.bind.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.xml.bind.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -31,8 +31,3 @@
 $(eval $(call SetupLauncher,xjc, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.xjc.Driver"$(COMMA) }'))
 
-jdk.xml.bind: $(LAUNCHERS)
-
-all: jdk.xml.bind
-
-.PHONY: all jdk.xml.bind
--- a/jdk/make/launcher/Launcher-jdk.xml.ws.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/Launcher-jdk.xml.ws.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -31,8 +31,3 @@
 $(eval $(call SetupLauncher,wsimport, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsImport"$(COMMA) }'))
 
-jdk.xml.ws: $(LAUNCHERS)
-
-all: jdk.xml.ws
-
-.PHONY: all jdk.xml.ws
--- a/jdk/make/launcher/LauncherCommon.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/launcher/LauncherCommon.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -23,10 +23,6 @@
 # questions.
 #
 
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
 include NativeCompilation.gmk
 
 # Prepare the find cache.
@@ -93,7 +89,7 @@
   $(call LogSetupMacroEntry,SetupLauncher($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11))
   $(if $(13),$(error Internal makefile error: Too many arguments to SetupLauncher, please update CompileLaunchers.gmk))
 
-  $1_WINDOWS_JLI_LIB := $(JDK_OUTPUTDIR)/objs/libjli/jli.lib
+  $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
   ifneq ($6, )
     $1_WINDOWS_JLI_LIB := $6
   endif
@@ -113,14 +109,14 @@
       endif
     endif
 
-    $1_LDFLAGS += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
+    $1_LDFLAGS += -Wl,-all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a \
         -framework Cocoa -framework Security -framework ApplicationServices \
         -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
         $1_LDFLAGS_SUFFIX += -pthread
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), aix)
-    $1_LDFLAGS_SUFFIX += -L$(JDK_OUTPUTDIR)/objs -ljli_static
+    $1_LDFLAGS_SUFFIX += -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE) -ljli_static
   endif
 
   ifeq ($(USE_EXTERNAL_LIBZ), true)
@@ -129,7 +125,7 @@
 
   $1_OUTPUT_DIR_ARG := $9
   ifeq (, $$($1_OUTPUT_DIR_ARG))
-    $1_OUTPUT_DIR_ARG := $(JDK_OUTPUTDIR)/bin
+    $1_OUTPUT_DIR_ARG := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)
   endif
 
   # TODO: maybe it's better to move this if-statement out of this function
@@ -189,10 +185,10 @@
       LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \
       LDFLAGS_SUFFIX_posix := $4, \
       LDFLAGS_SUFFIX_windows := $$($1_WINDOWS_JLI_LIB) \
-          $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5, \
-      LDFLAGS_SUFFIX_linux := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
-      LDFLAGS_SUFFIX_solaris := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/$1_objs$(OUTPUT_SUBDIR), \
+          $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib $5, \
+      LDFLAGS_SUFFIX_linux := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
+      LDFLAGS_SUFFIX_solaris := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs$(OUTPUT_SUBDIR), \
       OUTPUT_DIR := $$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR), \
       PROGRAM := $1, \
       DEBUG_SYMBOLS := true, \
@@ -205,14 +201,14 @@
       MANIFEST := $(JAVA_MANIFEST), \
       CODESIGN := $$($1_CODESIGN))
 
-  LAUNCHERS += $$(BUILD_LAUNCHER_$1)
+  TARGETS += $$(BUILD_LAUNCHER_$1)
 
   ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix))
-    $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjli_static.a
+    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
+    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \
         $$($1_WINDOWS_JLI_LIB)
   endif
 endef
--- a/jdk/make/lib/Awt2dLibraries.gmk	Wed Dec 03 14:26:07 2014 +0000
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Wed Jul 05 20:08:27 2017 +0200
@@ -23,7 +23,7 @@
 # questions.
 #
 
-WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib
+WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
 
 ################################################################################
 
@@ -66,12 +66,12 @@
         -D "JDK_FNAME=mlib_image.dll" \
         -D "JDK_INTERNAL_NAME=mlib_image" \
         -D "JDK_FTYPE=0x2L", \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image, \
+    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image, \
     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-$(BUILD_LIBMLIB_IMAGE): $(BUILD_LIBJAVA)
+$(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
 
-DESKTOP_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
+TARGETS += $(BUILD_LIBMLIB_IMAGE)
 
 ################################################################################
 
@@ -132,12 +132,12 @@
           $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_solaris := -lc, \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image_v, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image_v, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-  $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
+  $(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java)
 
-  DESKTOP_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
+  TARGETS += $(BUILD_LIBMLIB_IMAGE_V)
 
 endif
 
@@ -167,7 +167,7 @@
   LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
 endif
 
-LIBAWT_CFLAGS += -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
+LIBAWT_CFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
     $(addprefix -I, $(shell find $(LIBAWT_DIRS) -type d)) \
     $(LIBJAVA_HEADER_FLAGS) \
     $(addprefix -I, $(BUILD_LIBMLIB_IMAGE_SRC)) \
@@ -214,7 +214,7 @@
       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/java2d/opengl \
       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
-      -I$(JDK_OUTPUTDIR)/gensrc_headers/java.base \
+      -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
       #
   LIBAWT_EXFILES += \
       java2d/d3d/D3DShaderGen.c \
@@ -259,7 +259,8 @@
     LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \
     LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \
     LDFLAGS_SUFFIX_aix :=-ljvm $(LIBM) $(LIBDL) -ljava -lm,\
-    LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
+    LDFLAGS_SUFFIX_macosx := -L$(INSTALL_LIBRARIES_HERE) \
+        -lmlib_image -ljvm $(LIBM) \
         -framework Cocoa \
         -framework OpenGL \
         -framework JavaNativeFoundation \
@@ -281,16 +282,16 @@
         -D "JDK_FNAME=awt.dll" \
         -D "JDK_INTERNAL_NAME=awt" \
         -D "JDK_FTYPE=0x2L", \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt, \
+    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt, \
     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-$(BUILD_LIBAWT): $(BUILD_LIBJAVA)
+$(BUILD_LIBAWT): $(call FindLib, java.base, java)
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
 endif
 
-DESKTOP_LIBRARIES += $(BUILD_LIBAWT)
+TARGETS += $(BUILD_LIBAWT)
 
 ################################################################################
 
@@ -312,7 +313,7 @@
     LIBAWT_XAWT_EXCLUDES := medialib
 
     LIBAWT_XAWT_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBAWT_XAWT_DIRS) -type d)) \
-        -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
+        -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
         -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/include \
@@ -365,21 +366,22 @@
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS) \
             $(call SET_SHARED_LIBRARY_ORIGIN) \
-            $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
+            $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
+            -L $(INSTALL_LIBRARIES_HERE), \
         LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
         VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
         RC_FLAGS := $(RC_FLAGS) \
             -D "JDK_FNAME=xawt.dll" \
             -D "JDK_INTERNAL_NAME=xawt" \
             -D "JDK_FTYPE=0x2L", \
-        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \
+        OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_xawt, \
         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-    $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA)
+    $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
 
     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 
-    DESKTOP_LIBRARIES += $(BUILD_LIBAWT_XAWT)
+    TARGETS += $(BUILD_LIBAWT_XAWT)
 
   endif
 endif
@@ -387,7 +389,7 @@
 ################################################################################
 
 LIBLCMS_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/liblcms
-LIBLCMS_CPPFLAGS += -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
+LIBLCMS_CPPFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
     -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
     $(LIBJAVA_HEADER_FLAGS) \
@@ -419,6 +421,7 @@
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
+    LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
     LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
     LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc $(LCMS_LIBS), \
@@ -430,10 +433,10 @@
         -D "JDK_FNAME=lcms.dll" \
         -D "JDK_INTERNAL_NAME=lcms" \
         -D "JDK_FTYPE=0x2L", \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
+    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/liblcms, \
     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-DESKTOP_LIBRARIES += $(BUILD_LIBLCMS)
+TARGETS += $(BUILD_LIBLCMS)
 
 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 
@@ -492,7 +495,7 @@
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJAVAJPEG_SRC)) \
         $(LIBJAVA_HEADER_FLAGS) \
-        -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop, \
+        -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
     MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(LIBJPEG_LIBS) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -504,12 +507,12 @@
         -D "JDK_INTERNAL_NAME=javajpeg" \
         -D "JDK_FTYPE=0x2L", \
     REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavajpeg, \
+    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavajpeg, \
     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-$(BUILD_LIBJAVAJPEG): $(BUILD_LIBJAVA)
+$(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 
-DESKTOP_LIBRARIES += $(BUILD_LIBJAVAJPEG)
+TARGETS += $(BUILD_LIBJAVAJPEG)
 
 ################################################################################
 
@@ -522,7 +525,7 @@
       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt \
       $(JDK_TOPDIR)/src/java.desktop/share/native/common \
       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common -type d)) \
-    -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
+    -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
     $(LIBJAVA_HEADER_FLAGS) \
     #
 
@@ -578,6 +581,7 @@
     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
+    LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
     LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
     LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
     LDFLAGS_SUFFIX_solaris := $(filter-out -R%, $(X_LIBS)) \
@@ -592,7 +596,7 @@
         -D "JDK_FNAME=fontmanager.dll" \
         -D "JDK_INTERNAL_NAME=fontmanager" \
         -D "JDK_FTYPE=0x2L", \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \
+    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
@@ -601,7 +605,7 @@
   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
 endif
 
-DESKTOP_LIBRARIES += $(BUILD_LIBFONTMANAGER)
+TARGETS += $(BUILD_LIBFONTMANAGER)
 
 ################################################################################
 
@@ -612,7 +616,7 @@
       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/java2d/windows \
-      -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
+      -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
       $(LIBJAVA_HEADER_FLAGS) \
@@ -639,16 +643,16 @@
           -D "JDK_FNAME=jawt.dll" \
           -D "JDK_INTERNAL_NAME=jawt" \
           -D "JDK_FTYPE=0x2L", \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 
   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
 	$(ECHO) Copying $(@F)
-	$(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
+	$(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
 
-  DESKTOP_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
+  TARGETS += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 
 else # OPENJDK_TARGET_OS not windows
 
@@ -694,13 +698,14 @@
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
+      LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
       LDFLAGS_solaris := $(X_LIBS), \
       LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
       LDFLAGS_SUFFIX_aix := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
       LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \
       LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
           -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
   ifndef BUILD_HEADLESS_ONLY
@@ -715,7 +720,7 @@
 
 endif # OPENJDK_TARGET_OS
 
-DESKTOP_LIBRARIES += $(BUILD_LIBJAWT)
+TARGETS += $(BUILD_LIBJAWT)
 
 ################################################################################
 
@@ -732,7 +737,7 @@
         #
 
     LIBAWT_HEADLESS_EXCLUDES := medialib
-    LIBAWT_HEADLESS_CFLAGS := -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
+    LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
         $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
@@ -770,6 +775,7 @@
         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN), \
+        LDFLAGS_posix := -L $(INSTALL_LIBRARIES_HERE), \
         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
         LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
         LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
@@ -777,12 +783,12 @@
         LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
         LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
         LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
-        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
+        OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 
-    DESKTOP_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
+    TARGETS += $(BUILD_LIBAWT_HEADLESS)
 
   endif
 endif
@@ -853,7 +859,9 @@
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
+    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += \
+        -L$(INSTALL_LIBRARIES_HERE) \
+        $(LIBM) -lpthread -liconv -losxapp \
         -framework ApplicationServices \
         -framework Foundation \
         -framework Cocoa \
@@ -885,10 +893,10 @@
           -D "JDK_FNAME=splashscreen.dll" \
           -D "JDK_INTERNAL_NAME=splashscreen" \
           -D "JDK_FTYPE=0x2L", \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsplashscreen, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-  DESKTOP_LIBRARIES += $(BUILD_LIBSPLASHSCREEN)
+  TARGETS += $(BUILD_LIBSPLASHSCREEN)
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     $(BUILD_LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
@@ -909,7 +917,7 @@
 
   LIBAWT_LWAWT_CFLAGS := \
       $(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
-      -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
+      -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/include \
       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl \
@@ -945,7 +953,8 @@
           $(X_LIBS) \
           $(LIBAWT_LWAWT_CFLAGS), \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
-          $(call SET_SHARED_LIBRARY_ORIGIN), \
+          $(call SET_SHARED_LIBRARY_ORIGIN) \
+          -L $(INSTALL_LIBRARIES_HERE), \
       LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
           -framework Accelerate \
           -framework ApplicationServices \
@@ -958,10 +967,10 @@
           -framework JavaRuntimeSupport \
           -framework OpenGL \
           -framework QuartzCore -ljava, \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_lwawt, \
+      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_lwawt, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-  DESKTOP_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
+  TARGETS += $(BUILD_LIBAWT_LWAWT)
 
   $(