JDK-8133347 : Add makefiles support and basic session, persistence history navigation with jline
Type:Sub-task
Component:core-libs
Sub-Component:jdk.nashorn
Affected Version:9
Priority:P3
Status:Resolved
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2015-08-11
Updated:2015-09-10
Resolved:2015-08-13
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
I was getting compilation errors with my nashorn GNU makefile changes - as jdk.scripting.nashorn.shell module depends java.prefs module in addition to jdk.internal.le. Apparently, java.prefs is not yet built when jdk.scripting.nashorn.shell is being built! And because there is -bootclasspath setting in BuildNashorn.gmk, javac does not get to see classes from java.prefs module. Erik Joelsson helped me with the following suggestion by email:
Hello,
Please revert the following files and instead apply the patches below:
make/Main.gmk
make/CompileJavaModules.gmk
nashorn/make/BuildNashorn.gmk
diff -r 4c85a31c02e8 make/CompileJavaModules.gmk
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -491,6 +491,7 @@
$(CORBA_TOPDIR)/src/$1/share/classes \
$(JAXP_TOPDIR)/src/$1/share/classes \
$(JAXWS_TOPDIR)/src/$1/share/classes \
+ $(NASHORN_TOPDIR)/src/$1/share/classes \
#
ALL_SRC_DIRS = \
diff -r 33cecbc59f2a make/BuildNashorn.gmk
--- a/make/BuildNashorn.gmk
+++ b/make/BuildNashorn.gmk
@@ -53,7 +53,10 @@
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
# Build nashorn into intermediate directory
-$(eval $(call SetupJavaCompilation,BUILD_NASHORN, \
+# Name the compilation setup the same as the module, as is done in the global
+# CompileJavaModules.gmk, to make dependency checking with other modules work
+# seamlessly.
+$(eval $(call SetupJavaCompilation,jdk.scripting.nashorn, \
SETUP := GENERATE_NEWBYTECODE_DEBUG, \
SRC := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes, \
EXCLUDE_FILES := META-INF/MANIFEST.MF, \
@@ -71,7 +74,7 @@
ADD_JAVAC_FLAGS := -Xbootclasspath/p:"$(SUPPORT_OUTPUTDIR)/special_classes/jdk.scripting.nashorn/classes"))
# Nasgen needs nashorn classes
-$(BUILD_NASGEN): $(BUILD_NASHORN)
+$(BUILD_NASGEN): $(jdk.scripting.nashorn)
NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn
NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
/Erik