Recent Changes - Search:

edit SideBar

Nashorn

This page is about building Nashorn, see also JS.

Check Out the Repo

https://wiki.openjdk.java.net/display/Nashorn/Building+Nashorn says

 hg clone http://hg.openjdk.java.net/nashorn/jdk8 nashorn~jdk8

which is wrong:

bash-3.2$ hg clone http://hg.openjdk.java.net/nashorn/jdk8 nashorn~jdk8
abort: HTTP Error 404: Not Found
bash-3.2$

Try:

 hg clone http://hg.openjdk.java.net/jdk8/jdk8/nashorn

Build

 cd nashorn/make
 ant
 ant jar

Update the jar

The JDK includes a copy of nashorn.jar, which we want to replace.

To determine which JDK and which nashorn.jar was being used, I passed the -verbose flag to java.

With Ptolemy II, I did:

bash-3.2$ export JAVAFLAGS=-verbose
bash-3.2$ $PTII/bin/vergil -verbose org/terraswarm/accessor/demo/SecureSocket/SecureSocket.xml | grep nashorn.jar | head
[Loaded jdk.nashorn.api.scripting.NashornScriptEngineFactory from file:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/nashorn.jar]
...

So, the file to replace is /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/nashorn.jar.

As root, I backed it up and replaced it:

bash-3.2$ sudo -i
ealmac23:~ root# cd  /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext
ealmac23:ext root# mv nashorn.jar ..
ealmac23:ext root# mv ~cxh/.ptolemyII/nashorn.jar .
ealmac23:ext root# exit

Edit - History - Print - Recent Changes - Search
Page last modified on December 18, 2015, at 08:19 pm