I launch a jar with the latest version of OpenJDK 8:
/opt/jdk/jdk8u412-b08/bin/java -verbose -Djdk.tls.client.protocols="TLSv1.2" -cp "/applis/com/myapp/:/applis/com/myapp/myapp.jar" com.myapp.AppLauncher
...
[Loaded java.lang.reflect.InvocationTargetException from /opt/jdk/jdk8u412-b08/jre/lib/rt.jar]
[Loaded java.lang.Throwable$PrintStreamOrWriter from /opt/jdk/jdk8u412-b08/jre/lib/rt.jar]
[Loaded java.lang.Throwable$WrappedPrintStream from /opt/jdk/jdk8u412-b08/jre/lib/rt.jar]
[Loaded java.util.IdentityHashMap$IdentityHashMapIterator from /opt/jdk/jdk8u412-b08/jre/lib/rt.jar]
[Loaded java.util.IdentityHashMap$KeyIterator from /opt/jdk/jdk8u412-b08/jre/lib/rt.jar]
[Loaded java.lang.Shutdown from /opt/jdk/jdk8u412-b08/jre/lib/rt.jar]
[Loaded java.lang.Shutdown$Lock from /opt/jdk/jdk8u412-b08/jre/lib/rt.jar]
$ echo $?
0
$ /opt/jdk/jdk8u412-b08/bin/java -version
openjdk version "1.8.0_412"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_412-b08)
OpenJDK 64-Bit Server VM (Temurin)(build 25.412-b08, mixed mode)
The process stops without an error message and the exit code is 0.
On another machine (same OS - Red Hat Enterprise Linux Server release 7.9 (Maipo)
, same version of jdk , same jar), the process keeps on running. I can't work out what makes the java process stop.
The selinux is set to permissive on both machines:
$sudo getenforce
Permissive
In the folder /applis/com/myapp, there is only the jar file + a myapp.properties file. This file contains only name of servers. The file has not been modified. It is the same in both machines. Also, on the machine where it fails, the app manages to start with an old version of oracle jdk
Java(TM) SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
To summarize:
Machine 1 | Fails with openjdk-1.8.0_412 | Succeeds with JSE 1.8.0_101-b13
Machine2 | Succeeds with both openjdk-1.8.0_412 and JSE 1.8.0_101-b13
Same OS: Red Hat Enterprise Linux Server release 7.9 (Maipo)
This is an answer that does not explain how to debug the java. @elliotfrish and @cyberbrain did give enough explanations about that
Here is an explanation about why the openjdk 8 failed whereas the code was running fine on oracle jdk 8. The fact that I managed to launch the jar with openjdk8 on another VM also confirmed the issue was not on the jar itself but on the conf of the VM.
There was actually a font library missing on the VM. The installation of fontconfig.x86_64 and its dependencies solved the issue.