Changing JRE to OpenJDK 8

I’m trying to replace native “/usr/local/snap/jre” to “/usr/lib/jvm/java-8-openjdk-amd64/jre” on Debian Stretch and getting the next error while trying to call gpt -h:

Error: null
	at org.esa.s2tbx.jni.EnvironmentVariables.getCurrentDirectory(
	at org.esa.s2tbx.dataio.gdal.activator.GDALDistributionInstaller.install(
	at org.esa.s2tbx.dataio.gdal.activator.GDALPlugInActivator.start(
	at org.esa.snap.runtime.Engine.informActivators(
	at org.esa.snap.runtime.Engine.lambda$start$0(
	at org.esa.snap.runtime.Engine.runClientCode(
	at org.esa.snap.runtime.Engine.start(
	at org.esa.snap.runtime.Engine.start(
	at org.esa.snap.runtime.Launcher.main(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at com.exe4j.runtime.LauncherEngine.launch(
	at com.install4j.runtime.launcher.UnixLauncher.main(
Caused by: java.lang.NullPointerException
	at java.lang.ClassLoader.loadLibrary(
	at java.lang.Runtime.loadLibrary0(
	at java.lang.System.loadLibrary(
	at org.esa.s2tbx.jni.EnvironmentVariablesNative.<clinit>(
	... 16 more

I have replaced native JRE in such way:

cd /usr/local/snap
mv jre jre-old
ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre jre

By the moment, Debian Stretch version 9.12 image provides OpenJDK version “1.8.0_242”.

Do I miss some extra packages/libraries? Any hint is appreciated :slight_smile:

Currently SNAP 7 is not fully compatible with OpenJDK.
But SNAP 8 will be. The release is not to far away anymore.
So, for the moment you need to stick to the one which is provoded with SNAP.

Ah, I see, I’ve read that SNAP is not fully compatible with OpenJDK (but did not take it seriously). Moreover, OpenJDK itself seems not quite stable – just tried to replace SNAP’s embedded JRE with OpenJDK 8 on Ubuntu 16.04 Xenial, and the error above is no more (Ubuntu 16.04 has OpenJDK version 1.8.0_252).

It’s either OpenJDK 1.8.0_252 is ok, or Debian’s package is not. The problem seems solved for me.