Java version support

Hello,

I’m evaluating Aspose PSD before buying a developer OEM license but our application is running with a version 17 of Java.
Currently aspose PSD for java does not seem compatible with recent java versions.

We get such error:

Unable to make int java.util.regex.Matcher.getMatchedGroupIndex(java.lang.String) accessible: module java.base does not "opens java.util.regex" to unnamed module @5db6b9cd
java.lang.reflect.InaccessibleObjectException: Unable to make int java.util.regex.Matcher.getMatchedGroupIndex(java.lang.String) accessible: module java.base does not "opens java.util.regex" to unnamed module @5db6b9cd
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.aspose.psd.internal.cw.d.b(Unknown Source)
at com.aspose.psd.internal.cw.d.a(Unknown Source)
at com.aspose.psd.internal.je.b.a(Unknown Source)
at com.aspose.psd.internal.je.b.a(Unknown Source)
at com.aspose.psd.internal.je.b.a(Unknown Source)
at com.aspose.psd.fileformats.psd.layers.layerresources.Txt2Resource.a(Unknown Source)
at com.aspose.psd.internal.iS.ah.a(Unknown Source)
at com.aspose.psd.internal.iS.ah.a(Unknown Source)
at com.aspose.psd.internal.iS.ah.updateText(Unknown Source)
at com.aspose.psd.fileformats.psd.layers.TextLayer.updateText(Unknown Source)

We tried without success to solve the issue by adding JVM arguments like:
–add-opens java.base/java.util.regex=ALL-UNNAMED
–add-exports java.base/java.util.regex=ALL-UNNAMED

The only running workaround we found is downgrading the java version. It does not look like a solution for us.

Is their a decent way to resolve this issue ?
Is there a roadmap to support recent java versions?

Thank you for feedback
Alexandre

@alexlew Could you please provide code snippet and PSD file that you are trying to open/edit. We need to investigate this.

Hello @DmitriySorokin,

Even if it’s not really a full support of java 17, we finally figure out what are parameters to set. We forgot the first equal character:

--add-opens=java.base/java.util.regex=ALL-UNNAMED
--add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED

Furthermore, we need to set these parameters in different location to take care about tool we are using for executing the library (our tests vs our application).

Kind regards,
Alexandre