<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi!<div><br></div><div>Are you experiencing this with Nashorn 15.4 from <a href="https://github.com/openjdk/nashorn">https://github.com/openjdk/nashorn</a>? This issue is supposed to have been fixed since Nashorn 15.3 in this change <a href="https://github.com/openjdk/nashorn/pull/16">https://github.com/openjdk/nashorn/pull/16</a> according to the changelog: <a href="https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md">https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md</a></div><div><br></div><div>You say it fails, but it’s encased in a try-catch specifically for this reason. Can you give me a stack trace of how it fails?</div><div><br></div><div>Attila.</div><div><br><div><br><blockquote type="cite"><div>On 2024. Jan 24., at 13:02, Luc Chapon <sxilderik@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">Hello all</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">First message here</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">We are facing a problem re Nashorn (latest) and java17</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">In Context.java, line 330, you try to get a handle to a no longer existent method, Unsafe.defineAnonymousClass</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">And fail of course.</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">I’m trying to rewrite this part for our own temporary urgent need according to this.<br><br><a href="https://www.oracle.com/java/technologies/javase/17-relnote-issues.html">https://www.oracle.com/java/technologies/javase/17-relnote-issues.html</a><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><div style="box-sizing: border-box; margin: 0px; padding: 0px; list-style: none; background-repeat: no-repeat; font-family: OracleSansVF, OracleSansVFCyGr, OracleSansFB, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif; font-size: 14.63px; background-color: rgb(251, 249, 248);">core-libs</div></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><b style="box-sizing: border-box; margin: 0px; padding: 0px; list-style: none; background-repeat: no-repeat; font-family: OracleSansVF, OracleSansVFCyGr, OracleSansFB, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif; font-size: 14.63px; background-color: rgb(251, 249, 248);"><a href="https://www.oracle.com/java/technologies/javase/17-relnote-issues.html#JDK-8243287" style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat;color:rgb(0,107,143);text-decoration-line:none"><span class="gmail-arrow" style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">➜</span></a> Removal of sun.misc.Unsafe::defineAnonymousClass</b></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><p style="box-sizing: border-box; margin: 0px 0px 1.1em; padding: 0px; list-style: none; background-repeat: no-repeat; line-height: 1.55; font-family: OracleSansVF, OracleSansVFCyGr, OracleSansFB, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif; font-size: 14.63px; background-color: rgb(251, 249, 248);"><code style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">sun.misc.Unsafe::defineAnonymousClass</code> API has been removed in JDK 17. The API replacement is <code style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">java.lang.invoke.MethodHandles.Lookup::defineHiddenClass</code> and <code style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">java.lang.invoke.MethodHandles.Lookup::defineHiddenClassWithClassData</code>.</p></div></blockquote><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">Are you aware of the problem? Is there a fix already available?</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">Thank you!</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">Luc Chapon</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">ChapsVision</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">Suresnes, France</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div></div>
</div></blockquote></div><br></div></body></html>