RFR: JDK-8188012 Nashorn build targets version 9 source
Sundararajan Athijegannathan
sundararajan.athijegannathan at oracle.com
Wed Sep 27 09:32:54 UTC 2017
We run nasgen tool on the generated nashorn .class files to
post-process. nasgen used to run on boot JDK in the past (if I recall
right). I'm fine with current change is okay - so long as nasgen works
fine & nashorn tests run fine.
Please note that nashorn tests are run with "ant".
cd $jdk10/make/nashorn
export JAVA_HOME=<your_jdk10_image_jdk_dir>
ant clean test
-Sundar
On 27/09/17, 2:25 PM, David Holmes wrote:
> On 27/09/2017 6:30 PM, Magnus Ihse Bursie wrote:
>>
>> The nashorn java code requires a somewhat convoluted compilation. As
>> a result, we use a special java compiler setup,
>> GENERATE_NEWBYTECODE_DEBUG. This explicitly lists -source 9 -target
>> 9, which generates this warning:
>>
>> warning: [options] bootstrap class path not set in conjunction with
>> -source 1.9
>>
>> when building in jdk10. I assume this is just a mistake, and that it
>> should really target 10. (Or, to always be in sync, perhaps even
>> $(VERSION_MAJOR)).
>
> Seems like a reasonable assumption. Though one has to wonder why we
> even set the source/target? That would only be necessary if we needed
> to force building to an older level. I think these could just be removed.
>
> Cheers,
> David
>
>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8188012
>> Patch inline:
>> diff --git a/make/BuildNashorn.gmk b/make/BuildNashorn.gmk
>> --- a/make/BuildNashorn.gmk
>> +++ b/make/BuildNashorn.gmk
>> @@ -41,7 +41,7 @@
>> $(eval $(call SetupJavaCompiler, GENERATE_NEWBYTECODE_DEBUG, \
>> JVM := $(JAVA_JAVAC), \
>> JAVAC := $(NEW_JAVAC), \
>> - FLAGS := -g -source 9 -target 9 --upgrade-module-path
>> "$(JDK_OUTPUTDIR)/modules/" \
>> + FLAGS := -g -source 10 -target 10 --upgrade-module-path
>> "$(JDK_OUTPUTDIR)/modules/" \
>> --system none --module-source-path $(call
>> GetModuleSrcPath), \
>> SERVER_DIR := $(SJAVAC_SERVER_DIR), \
>> SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
>>
>> /Magnus
More information about the nashorn-dev
mailing list