Does Nashorn (org.openjdk.nashorn) have any support for Java 17?

2021-06-28 Thread Greg Watts
Dear Nashorn development team, I am trying to run an ANT build of our product using nashorn-core:15.1.1.jar with Java 17 (pre-release - build 27) and I get: BUILD FAILED java.lang.ExceptionInInitializerError at org.openjdk.nashorn.internal.runtime.Context.compile(Context.java:1509) at o

Re: Does Nashorn (org.openjdk.nashorn) have any support for Java 17?

2021-06-28 Thread Attila Szegedi
Hi Greg, that’s a consequence of Java 17 removing the Unsafe.defineAnonymousClass method. Unfortunately, we don’t have an ideal replacement for it yet. MethodHandles.Lookup.defineHiddenClass is supposed to be a publicly supported replacement, but it hides the generated classes from stack traces

Re: Does Nashorn (org.openjdk.nashorn) have any support for Java 17?

2021-06-28 Thread Remi Forax
- Original Message - > From: "Attila Szegedi" > To: "nashorn-dev" > Cc: "Greg Watts" > Sent: Lundi 28 Juin 2021 19:07:38 > Subject: Re: Does Nashorn (org.openjdk.nashorn) have any support for Java 17? > Hi Greg, > > that’s a consequence of Java 17 removing the Unsafe.defineAnonymousCla

Re: Does Nashorn (org.openjdk.nashorn) have any support for Java 17?

2021-06-28 Thread Attila Szegedi
> On 2021. Jun 28., at 19:30, Remi Forax wrote: > > > In the meantime, I think you can use Lookup.defineClass() or do you rely on > the weird security model of the anonymous classes ? Thankfully, no. Nashorn regenerates code for the same function sometimes so it was convenient having old ver