1

I'm running an application using Java Webstart but it requires opening a module when run with Java 9+:

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 @207bb528

How do I need to modify my jnlp to make it work?

1 Answer 1

3

With java, you would use, for example:

java --add-opens java.base/java.lang=ALL-UNNAMED

In a JNLP file, you would do the same but need to replace the space with a "=", for example:

<j2se version="1.8.0_45+" java-vm-args="--add-opens=java.base/java.lang=ALL-UNNAMED"/>
Sign up to request clarification or add additional context in comments.

1 Comment

It still works with Java 16, I use it to make EasyMock work but I'm not sure it still works with Java 17 because of strong encapsulation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.