Unable to start Spring Boot executable jar using IBM JRE 1.8

692 views Asked by At

We have a Spring Boot application which is built as an executable jar and runs fine using both the Oracle and OpenJDK JREs (using 1.8 versions).

Attempting to run it using the IBM 1.8 JRE however results in the following error at the command line.

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

This occurs if we execute the jar (using ./application.jar) or using java -jar application.jar

This led us to change the packaging to not make the jar executable and this allows us to start the application using java -jar application.jar. So it appears the IBM JRE doesn't like the launch script.

The problem is we don't want to have two packaging methods for different deployment environments, if possible.

Does anyone have any experience of why the IBM JRE doesn't like the script on the front of the jar file and whether there are any command line options to disable whatever checking its doing?

1

There are 1 answers

2
Marcin P On

From your post it is unclear if you have problem with 1) running jar from Linux like chmod a+x application.jar and executing Or 2) running via /opt/IBM/java/jre/bin/java -jar application.jar

For option 1) it is not a good idea as you do not explicitly choose jvm binary and rely on OS to choose one for you. Read about binfmt_misc mechanism:

https://en.m.wikipedia.org/wiki/Binfmt_misc

For option 2)-it might be class loading problem, please add /opt/IBM/java/jre/bin/java -verbose:class -jar application.jar

and consult documentation here: https://www.ibm.com/developerworks/library/j-dclp1/index.html