@atlassian/soy-loader incompatible with JDK 17?

@mkemp any ideas?

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not “opens java.lang” to unnamed module @59a635aa
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at com.google.inject.internal.cglib.core.$ReflectUtils$2.run(ReflectUtils.java:56)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at com.google.inject.internal.cglib.core.$ReflectUtils.(ReflectUtils.java:46)
… 44 more

at /Users/rlander/scriptrunner/frontend/node_modules/@atlassian/soy-loader/index.js:99:25
at Array.forEach (<anonymous>)
at ChildProcess.<anonymous> (/Users/rlander/scriptrunner/frontend/node_modules/@atlassian/soy-loader/index.js:92:13)

Ah, I’ve now found: [SPFE-1066] - Ecosystem Jira

Bummer

This is a bit of a blocker because we’ve moved our whole build over to JDK 17 now

Thanks for reporting this and checking the backlog. My team owns this component. The wide collection Soy tool JS utils is a bit of a mess that we first need to figure out what to do with, many of them in a derelict state.

In the meantime, try setting the environment variable (you may need to export it, honestly I haven’t tried yet) JAVA_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED" and adding arguments until it works. Internally there’s reflection going on and from JRE17 that’s disabled by default.

Will have a look and see if I can hack it. Ideally the library itself would set up the forked JVM correctly, but I see you’ve made that suggestion on the related issue.

It’s solved a few days ago by Atlassian in @atlassian/soy-loader 5.3.8. No need for @mkemp 's JAVA_OPTS anymore! Thank you all of you who participated to fixing this issue :partying_face::trophy::confetti_ball::raised_hands: !