diff --git a/langtools/make/CompileInterim.gmk b/langtools/make/CompileInterim.gmk
index 2ccd58feaa2..06a13d92ba8 100644
--- a/langtools/make/CompileInterim.gmk
+++ b/langtools/make/CompileInterim.gmk
@@ -32,23 +32,35 @@ include JavaCompilation.gmk
include SetupJavaCompilers.gmk
################################################################################
-# Setup the rules to build the interim langtools jar, which is compiled by
-# the boot javac and can be run on the boot jdk. This will be used to compile
-# the rest of the product. Include the Genstubs build tool in this compilation
-# as it will be used together with the interim javac.
-$(eval $(call SetupJavaCompilation,BUILD_INTERIM_LANGTOOLS, \
- SETUP := BOOT_JAVAC, \
- DISABLE_SJAVAC := true, \
- SRC := $(LANGTOOLS_TOPDIR)/src/java.compiler/share/classes \
- $(LANGTOOLS_TOPDIR)/src/jdk.compiler/share/classes \
- $(LANGTOOLS_TOPDIR)/src/jdk.javadoc/share/classes \
- $(LANGTOOLS_TOPDIR)/src/jdk.jdeps/share/classes \
- $(SUPPORT_OUTPUTDIR)/gensrc/jdk.compiler \
- $(SUPPORT_OUTPUTDIR)/gensrc/jdk.javadoc \
- $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdeps, \
- EXCLUDES := sun, \
- COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
- BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_interim_classes, \
- JAR := $(INTERIM_LANGTOOLS_JAR)))
+# Setup the rules to build interim langtools, which is compiled by the boot
+# javac and can be run on the boot jdk. This will be used to compile
+# the rest of the product. Each module is compiled separately to allow a modular
+# boot jdk to override system classes using -Xoverride:.
-all: $(BUILD_INTERIM_LANGTOOLS)
+# Param 1 - Name of module to compile
+# Param 2 - Name of modules to depend on
+define SetupInterimModule
+ $$(eval $$(call SetupJavaCompilation,BUILD_INTERIM_$(strip $1), \
+ SETUP := BOOT_JAVAC, \
+ DISABLE_SJAVAC := true, \
+ SRC := $(LANGTOOLS_TOPDIR)/src/$(strip $1)/share/classes \
+ $$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)), \
+ EXCLUDES := sun com/sun/tools/jdeps com/sun/tools/javap, \
+ EXCLUDE_FILES := module-info.java, \
+ COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
+ BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/$(strip $1), \
+ ADD_JAVAC_FLAGS := -Xbootclasspath/p:$$(call PathList, \
+ $$(foreach m, $2, $(BUILDTOOLS_OUTPUTDIR)/override_modules/$$m)), \
+ ))
+
+ $$(BUILD_INTERIM_$(strip $1)): $$(foreach m, $2, $$(BUILD_INTERIM_$(strip $$m)))
+
+ TARGETS += $$(BUILD_INTERIM_$(strip $1))
+endef
+
+$(eval $(call SetupInterimModule, java.compiler))
+$(eval $(call SetupInterimModule, jdk.compiler, java.compiler))
+$(eval $(call SetupInterimModule, jdk.jdeps, jdk.compiler java.compiler))
+$(eval $(call SetupInterimModule, jdk.javadoc, java.compiler jdk.compiler))
+
+all: $(TARGETS)
diff --git a/langtools/make/build.properties b/langtools/make/build.properties
index fdc1aa05c0b..38939fa856f 100644
--- a/langtools/make/build.properties
+++ b/langtools/make/build.properties
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2016, 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,58 +24,13 @@
#
#javac configuration for "normal build" (these will be passed to the bootstrap compiler):
-javac.debug = true
-javac.debuglevel = source,lines,vars
-javac.extra.opts=-XDignore.symbol.file=true
-javac.includes=
-javac.lint.opts = -Xlint:all,-deprecation -Werror
-javac.source = 8
-javac.target = 8
+javac.opts = -XDignore.symbol.file=true -Xlint:all,-deprecation,-options -Werror -g:source,lines,vars
+javac.source = 9
+javac.target = 9
-#javac configuration for bootstrap build (these will be passed to the compiler from the given boot JDK):
-boot.javac.extra.opts=-XDignore.symbol.file=true
-boot.javac.includes = \
- javax/annotation/processing/ \
- javax/lang/model/ \
- javax/tools/ \
- jdk/ \
- com/sun/source/ \
- com/sun/tools/javac/ \
- com/sun/tools/doclint/
-boot.javac.lint.opts=
-boot.javac.source = 8
-boot.javac.target = 8
-
-#configuration of submodules (share by both the bootstrap and normal compilation):
-langtools.modules=java.compiler:jdk.compiler:jdk.jdeps:jdk.javadoc:jdk.jshell:jdk.internal.le:jdk.jdi
-java.compiler.dependencies=
-jdk.compiler.dependencies=java.compiler
-jdk.javadoc.dependencies=java.compiler:jdk.compiler
-jdk.jdeps.dependencies=java.compiler:jdk.compiler
-jdk.internal.le.dependencies=
-jdk.jdi.dependencies=
-jdk.jshell.dependencies=java.compiler:jdk.internal.le:jdk.compiler:jdk.jdi
-
-tool.javac.main.class=com.sun.tools.javac.Main
-tool.javadoc.main.class=com.sun.tools.javadoc.Main
-tool.javap.main.class=com.sun.tools.javap.Main
-tool.javah.main.class=com.sun.tools.javah.Main
-tool.sjavac.main.class=com.sun.tools.sjavac.Main
-tool.jshell.main.class=jdk.internal.jshell.tool.JShellTool
-
-javac.resource.includes = \
+langtools.resource.includes = \
com/sun/tools/javac/resources/compiler.properties
-#test configuration:
-jtreg.tests=
-boot.javac.tests = tools/javac
-crules.tests = ../make/test/crules
-
-#javadoc configuration
-javadoc.jls.cite=The Java™ Language Specification
-javadoc.jls.option=-tag "jls:a:See <cite>${javadoc.jls.cite}</cite>:" \
- -tag "implNote:a:Implementation Note:"
-
# Version info -- override as needed
jdk.version = 9
build.number = b00
@@ -89,3 +44,14 @@ milestone = internal
# FIXME -- need to include openjdk as needed
release = ${jdk.version}-${milestone}
full.version = ${release}+${build.number}
+
+#tools configuration:
+tool.javac.main.class=com.sun.tools.javac.Main
+tool.javadoc.main.class=jdk.javadoc.internal.tool.Main
+tool.javap.main.class=com.sun.tools.javap.Main
+tool.javah.main.class=com.sun.tools.javah.Main
+tool.sjavac.main.class=com.sun.tools.sjavac.Main
+tool.jshell.main.class=jdk.internal.jshell.tool.JShellTool
+
+#test configuration:
+jtreg.tests=
diff --git a/langtools/make/build.xml b/langtools/make/build.xml
index 051eae55c68..ee0c3281c49 100644
--- a/langtools/make/build.xml
+++ b/langtools/make/build.xml
@@ -1,28 +1,28 @@
+ ~ Copyright (c) 2007, 2016, 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.
+ -->
@@ -80,25 +70,19 @@
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ant.home = ${ant.home}
- boot.java.home = ${boot.java.home}
- target.java.home = ${target.java.home}
- jtreg.home = ${jtreg.home}
- findbugs.home = ${findbugs.home}
- checkstyle.home = ${checkstyle.home}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- crules.CodingRulesAnalyzerPlugin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Unofficial Javadoc generated from developer sources for preview purposes only]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -917,5 +143,207 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/langtools/make/gendata/Gendata-jdk.compiler.gmk b/langtools/make/gendata/Gendata-jdk.compiler.gmk
index 2e89ce75b33..613e7133a05 100644
--- a/langtools/make/gendata/Gendata-jdk.compiler.gmk
+++ b/langtools/make/gendata/Gendata-jdk.compiler.gmk
@@ -39,6 +39,10 @@ $(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols, \
))
+ifeq ($(BOOT_JDK_MODULAR), true)
+ COMPILECREATESYMBOLS_ADD_EXPORTS := -XaddExports:jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED,jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
+endif
+
$(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \
$(COMPILE_CREATE_SYMBOLS) \
$(wildcard $(LANGTOOLS_TOPDIR)/make/data/symbols/*)
@@ -46,6 +50,7 @@ $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \
$(MKDIR) -p $(@D)
$(ECHO) Creating ct.sym classes
$(JAVA) $(INTERIM_LANGTOOLS_ARGS) \
+ $(COMPILECREATESYMBOLS_ADD_EXPORTS) \
-classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \
build.tools.symbolgenerator.CreateSymbols \
build-ctsym \
diff --git a/langtools/make/intellij/ant.xml b/langtools/make/intellij/ant.xml
index a0570d25d90..e052d8b04b1 100644
--- a/langtools/make/intellij/ant.xml
+++ b/langtools/make/intellij/ant.xml
@@ -3,16 +3,12 @@
-
-
+
-
-
+
-
-
diff --git a/langtools/make/intellij/build.xml b/langtools/make/intellij/build.xml
index 2be2b302942..a6f1bd2fea8 100644
--- a/langtools/make/intellij/build.xml
+++ b/langtools/make/intellij/build.xml
@@ -15,8 +15,7 @@
-
-
+
@@ -28,18 +27,13 @@
-
-
-
-
-
+
-
+
-
diff --git a/langtools/make/intellij/langtools.iml b/langtools/make/intellij/langtools.iml
index 582abf11192..29ff589f35c 100644
--- a/langtools/make/intellij/langtools.iml
+++ b/langtools/make/intellij/langtools.iml
@@ -8,12 +8,11 @@
-
-
-
-
-
+
+
+
+
diff --git a/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java b/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
index 759e5bf7c28..ba4ce9500a6 100644
--- a/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
+++ b/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
@@ -124,8 +124,8 @@ public final class LangtoolsIdeaAntLogger extends DefaultLogger {
* This enum is used to represent the list of tasks we need to keep track of during logging.
*/
enum Task {
- /** javac task - invoked during compilation */
- JAVAC("javac", MessageKind.JAVAC_ERROR, MessageKind.JAVAC_WARNING, MessageKind.JAVAC_NOTE,
+ /** exec task - invoked during compilation */
+ JAVAC("exec", MessageKind.JAVAC_ERROR, MessageKind.JAVAC_WARNING, MessageKind.JAVAC_NOTE,
MessageKind.JAVAC_NESTED_DIAG, MessageKind.JAVAC_CRASH),
/** jtreg task - invoked during test execution */
JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR, MessageKind.JTREG_TEST_REPORT),
diff --git a/langtools/make/intellij/workspace.xml b/langtools/make/intellij/workspace.xml
index c2d0742f23e..dc21405c632 100644
--- a/langtools/make/intellij/workspace.xml
+++ b/langtools/make/intellij/workspace.xml
@@ -7,14 +7,14 @@
-
+
-
+
-
-
+
+
@@ -27,13 +27,14 @@
+
-
+
-
-
+
+
@@ -46,13 +47,14 @@
+
-
+
-
-
+
+
@@ -65,13 +67,14 @@
+
-
+
-
-
+
+
@@ -84,13 +87,14 @@
+
-
+
-
-
+
+
@@ -103,13 +107,15 @@
+
-
+
-
+
+
@@ -120,24 +126,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
@@ -181,4 +174,3 @@
-
diff --git a/langtools/make/launcher.sh-template b/langtools/make/launcher.sh-template
index 939752503e0..728d6bce0ba 100644
--- a/langtools/make/launcher.sh-template
+++ b/langtools/make/launcher.sh-template
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2016, 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,22 +31,10 @@ case `uname -s` in
mydir=`cygpath -m $mydir`
;;
esac
-mylib="$mydir/../lib"
+mylib="$mydir/../modules"
-# By default, put the jar file and its dependencies on the bootclasspath.
-# This is always required on a Mac, because the system langtools classes
-# are always on the main class path; in addition, it may be required on
-# standard versions of JDK (i.e. using rt.jar and tools.jar) because some
-# langtools interfaces are in rt.jar.
-# Assume that the jar file being invoked lists all the necessary langtools
-# jar files in its Class-Path manifest entry, so there is no need to search
-# dependent jar files for additional dependencies.
-
-if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then
- cp=`echo "$mylib"/*.jar |
- sed -e 's|\([a-z.]*\.jar\) *|\1#PS#|g'`
- bcp=$cp
-fi
+# patch langtools modules
+bcp=-Xpatch:"$mylib"
# tools currently assumes that assertions are enabled in the launcher
ea=-ea:com.sun.tools...
@@ -71,4 +59,4 @@ done
unset DUALCASE
IFS=$nl
-"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} #PROGRAM# ${toolOpts}
+"#TARGET_JAVA#" $bcp ${ea} ${javaOpts} #PROGRAM# ${toolOpts}
diff --git a/langtools/make/netbeans/langtools/build.xml b/langtools/make/netbeans/langtools/build.xml
index 0013b62228e..20de2fc70da 100644
--- a/langtools/make/netbeans/langtools/build.xml
+++ b/langtools/make/netbeans/langtools/build.xml
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
+
Must set property 'includes'
-
-
@@ -81,12 +72,11 @@
the user.
-->
-
-
-
+
-
+
@@ -102,17 +92,14 @@
-
-
-
-
-
+
+
-
+
Must set property 'run.classname'
@@ -123,22 +110,12 @@
test all tools.
-->
-
-
-
-
-
-
-
-
-
-
-
+
-
@@ -173,29 +150,27 @@
-
-
+
+
-
+
-
+
Must set property 'debug.classname'
-
+
Must set property 'jtreg.tests'
+ jpda.jvmargs="${jpda.jvmargs}"/>
@@ -206,11 +181,7 @@
-
-
-
+
@@ -218,23 +189,11 @@
-
-
-
-
-
-
-
-
@@ -244,32 +203,22 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
@@ -285,11 +234,7 @@
-
-
-
-
+
",
- "\n"
- + "\n"
- + "
\n"
- + "
Profiles
",
"