Stardog Java API with JDK 17

Hi
We've been using Java 11 to develop our application hitting Stardog as the database. We recently decided to upgrade to Java 17 but unfortunately we're getting the below error. We also tried "--add-opens java.base/java.lang=ALL-UNNAMED" as a JVM option, but no effect and the same error exists. In this link : System Requirements | Stardog Documentation Latest is mentioned that Stardog itself just works on Java 11, does it mean that the Java API also works with Java 11? Any help/comment on this is appreciated.

Unable to make field protected volatile java.io.InputStream java.io.FilterInputStream.in accessible: module java.base does not "opens java.io" to unnamed module @5fb759d6
java.lang.reflect.InaccessibleObjectException: Unable to make field protected volatile java.io.InputStream java.io.FilterInputStream.in accessible: module java.base does not "opens java.io" to unnamed module @5fb759d6
	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.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at com.complexible.stardog.protocols.http.client.ApacheHttp$HttpResponses.getHttpTrailers(ApacheHttp.java:554)
	at com.complexible.stardog.protocols.http.client.BaseHttpClient.onResponseEnd(BaseHttpClient.java:577)
	at com.complexible.stardog.protocols.http.client.HttpClientImpl.lambda$getTupleResultsFromHttpContext$4(HttpClientImpl.java:389)
	at com.complexible.common.base.AutoCloser.close(AutoCloser.java:50)
	at com.complexible.common.base.AutoCloser.close(AutoCloser.java:37)
	at com.stardog.stark.query.io.AsyncSelectQueryResult.close(AsyncSelectQueryResult.java:57)
	at com.complexible.stardog.api.impl.AbstractConnection$OnCloseQueryResult.close(AbstractConnection.java:773)
	at

Hi Cesar,

Yes, you must use Java 11 with the Java API, as well. The Java API is just another way to issue commands to your Stardog server, so the version requirement for Stardog necessarily applies to the API.

Best,
Steve

1 Like

Thank you @StevePlace. Just a follow up question, is there any plan for such an upgrade in Stardog?

Hi Cesar,

We typically upgrade Java versions with new major releases of Stardog, but I don't have any information on which version we'll upgrade to for the release of Stardog 10 (if we upgrade versions at all).

Best,
Steve

1 Like

Hi @StevePlace
I was wondering whether you have any news on the server's potential java version update.
Thank you

Hi Cesar,

We're still using Java 11. You can check the System Requirements section of our documentation when we release new versions of Stardog to see which Java version we support. As you can see in its current form, it still says:

Stardog 9+ is tested on Java version 11, and requires sun.misc.Unsafe. Note that Stardog does not run on any other versions of Java.

Best,
Steve

Hi @StevePlace
I was wondering if you have any update on this. Thanks you.

Hi Cesar,

No update still unfortunately. You can check the System Requirements section of our documentation when we release new versions of Stardog to see which Java version we support.

Best,
Steve

1 Like