[graalvm-users] Migrate from Nashhorn JSR 223 Scripting Engine to Graal

Christian Wirth christian.wirth at oracle.com
Fri Jun 22 00:48:46 PDT 2018


Hi Andreas,

currently, we strongly endorse the use of GraalVM. That guarantees that 
you use Graal JavaScript with Graal as optimizing compiler.

What you tried to achieve will work; note, however, that in such a setup 
(on JDK 8) Graal is NOT used as optimzing compiler (but HotSpot Server 
Compiler C2 is), thus the performance of Graal JavaScript will likely be 
much worse than it would be on GraalVM.

Your commandline was probably missing the 
$GRAALVM/jre/lib/boot/graaljs-scriptengine.jar file? I am using a 
commandline like:

    GRAALVM=/path/to/GraalVM
    /path/to/jdk8/bin/java -cp 
$GRAALVM/jre/languages/js/graaljs.jar:$GRAALVM/jre/lib/truffle/truffle-api.jar:$GRAALVM/jre/lib/boot/graal-sdk.jar:$GRAALVM/jre/lib/boot/graaljs-scriptengine.jar:$GRAALVM/jre/tools/regex/tregex.jar:. 
MyJavaApp

In MyJavaApp, you can start Graal JavaScript via ScriptEngine; it 
registers under several names, including "graal.js". Again, note that 
performance will be suboptimal this way; use GraalVM for better results.

For JDK 11 and beyond, you can execute Graal JavaScript with Graal as 
optimizing compiler on a stock JVM already. We are currently working on 
improved packaging/modularizing and should be able to publish some 
documentation on that in the coming weeks.

Best,
Christian Wirth
Graal JavaScript team




> *From: *Andreas Mueller <am at iit.de <mailto:am at iit.de>>
> *Subject: **[graalvm-users] Migrate from Nashhorn JSR 223 Scripting 
> Engine to Graal*
> *Date: *18 June 2018 at 15:05:22 CEST
> *To: *graalvm-users at oss.oracle.com <mailto:graalvm-users at oss.oracle.com>
>
> Hi,
>
> I was cold hitted by the announcement that Nashorn might be deprecated 
> in future. Since we have a lot JS scripts implemented that run on the 
> JVM and interact with Java very well, I need an alternative JSR 223 
> JavaScript engine. So GraalVM comes to mind (and is suggested).
>
> GraalVM seems to me a JDK replacement rather than a scripting engine. 
> I downloaded it but didn’t find a jar file (such as graaljs.jar) that 
> contains the JSR 223 engine and that I just add to the classpath of a 
> legacy JDK 1.8.x and then it is automatically available when I list 
> the engines.
>
> Can anybody tell me how I can achieve this?
>
> Thanks,
> Andreas
>
> -- 
> Andreas Mueller
> IIT Software GmbH
> http://www.swiftmq.com 
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.swiftmq.com&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=YTqH_mQDw9AIEnzBrfofwq1rYWCuIWhxyDyBDa9EcyY&s=xqkFZTExfE1C8Gd457Rf-iFF0BBPX6l1-XSW791i2H4&e=>
>
>
>
>
> ------------------------------------------------------------------------
> IIT Software GmbH
> Falkenhorst 11, 48155 Münster, Germany
> Phone: +49 (0)251 39 72 99 00
> Managing Director: Andreas Müller
> District Court: Amtsgericht Münster, HRB 16294
> VAT-No: DE199945912
>
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> _______________________________________________
> GraalVM-Users mailing list
> GraalVM-Users at oss.oracle.com <mailto:GraalVM-Users at oss.oracle.com>
> https://oss.oracle.com/mailman/listinfo/graalvm-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20180622/7aa5eb97/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swiftmq_logo_positiv.png
Type: image/png
Size: 14410 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/graalvm-users/attachments/20180622/7aa5eb97/attachment-0001.png 


More information about the GraalVM-Users mailing list