Java warnings when using OpenJDK version 24

Hello,
You might already be aware but in case you’re not I just wanted to report some Java warnings. I’m seeing them when using RiskScape under OpenJDK v24 and I have not seen before under v23. I encounter these warnings both under RiskScape Core Engine v1.9.0 and RiskScape Core Engine v1.11.0-dev (the two versions I’ve tried):

checking environment..
openjdk version "24.0.2-internal" 2025-07-15
OpenJDK Runtime Environment (build 24.0.2-internal-adhoc.conda.src)
OpenJDK 64-Bit Server VM (build 24.0.2-internal-adhoc.conda.src, mixed mode, sharing)
starting up riskscape...
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.jna.Native in an unnamed module (file:/riskscape/lib/jna-5.9.0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

RiskScape Core Engine v1.9.0
----------------------------
Build time - Wed Mar 12 03:04:26 UTC 2025
Git SHA1   - ec22dcbdffa49e68643af138bd3eb18705b7126b

Plugins:
engine       1.9.0  nz.org.riskscape.engine.core.EnginePlugin
cli          1.9.0  nz.org.riskscape.engine.cli.CliPlugin
cpython      1.9.0  nz.org.riskscape.cpython.CPythonPlugin
defaults     1.9.0  nz.org.riskscape.engine.defaults.Plugin
jython       1.9.0  nz.org.riskscape.jython.Plugin
postgis      1.9.0  nz.org.riskscape.postgis.Plugin
wizard       1.9.0  nz.org.riskscape.wizard.WizardPlugin
wizard-cli   1.9.0  nz.org.riskscape.wizard.WizardCliPlugin

System:
Linux 5.14.0-427.13.1.el9_4.x86_64
Java 24.0.2-internal OpenJDK 64-Bit Server VM 24.0.2-internal-adhoc.conda.src
checking environment..
openjdk version "24.0.2-internal" 2025-07-15
OpenJDK Runtime Environment (build 24.0.2-internal-adhoc.conda.src)
OpenJDK 64-Bit Server VM (build 24.0.2-internal-adhoc.conda.src, mixed mode, sharing)
starting up riskscape...
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.jna.Native in an unnamed module (file:/riskscape/riskscape/lib/jna-5.9.0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

RiskScape Core Engine v1.11.0-dev
---------------------------------
Build time - Wed Aug 06 23:33:46 UTC 2025
Git SHA1   - 274486618b5c5fbc9a7eee4476b5a84d427cde44

Plugins:
engine       1.11.0-dev  nz.org.riskscape.engine.core.EnginePlugin
cli          1.11.0-dev  nz.org.riskscape.engine.cli.CliPlugin
cpython      1.11.0-dev  nz.org.riskscape.cpython.CPythonPlugin
defaults     1.11.0-dev  nz.org.riskscape.engine.defaults.Plugin
jython       1.11.0-dev  nz.org.riskscape.jython.Plugin
postgis      1.11.0-dev  nz.org.riskscape.postgis.Plugin
wizard       1.11.0-dev  nz.org.riskscape.wizard.WizardPlugin
wizard-cli   1.11.0-dev  nz.org.riskscape.wizard.WizardCliPlugin

System:
Linux 5.14.0-427.13.1.el9_4.x86_64
Java 24.0.2-internal OpenJDK 64-Bit Server VM 24.0.2-internal-adhoc.conda.src

Cheers,
Luisa

Hi Luisa

Thanks for reporting this. We haven’t used JDK24 for RiskScape much yet so good to know about these warnings.

I’ve just found another warning to:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::invokeCleaner has been called by org.geotools.util.NIOUtilities$CleanupAfterJdk8 (file:/home/glennw/projects/riskscape/riskscape/engine/app/build/install/riskscape/lib/gt-metadata-31.2.jar)
WARNING: Please consider reporting this to the maintainers of class org.geotools.util.NIOUtilities$CleanupAfterJdk8
WARNING: sun.misc.Unsafe::invokeCleaner will be removed in a future release

The warning you found could be silenced by setting RISKSCAPE_OPTS to –enable-native-access=ALL-UNNAMED see Tips and tricks for details.

But this new warning will need software updates and could make using RiskScape with JDK24 quite noisy.

We will look into these and hopefully have a resolution soon.

Thanks
Glenn

Hi Glenn
Thanks for looking into this. I might stick to JDK 23 for now then.
Best
Luisa