As400 run a personal JRE

521 Views Asked by At

i have a java program that must run on an as400, running it from qshel run jre 1.6, but my dependencies require jre 1.8 is it possible to start that program with portable 1.8 jre? as is also done on Windows and Linux with the .bat and .sh files!

can you tell me the commands to customize the (java home) without moving the 1.6 installed?

2

There are 2 best solutions below

2
Kevin Adler On BEST ANSWER

Traditionally, the only JVMs available for the IBM i platform come from IBM. These are available through various options of the 5770-JV1 product. Versions up to 1.8 are available for IBM i 7.1 and up (perhaps earlier, but I haven't gone digging) You can find the available JVM options at https://www.ibm.com/support/pages/node/1117869

To use a Java 1.8 64-bit VM from QSH, you could do eg.

JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit
export JAVA_HOME
java -jar ...
2
JRichardsz On

Your challenge is a very common task in legacy systems.

This worked for me:

  • Put your portable jre.zip close to your java program.
  • Unzip it
  • Create a JAVA_HOME just for this execution:
export JAVA_HOME=/home/mydownloads/jre
export PATH=${PATH}:$JAVA_HOME/bin
  • Try with java -version
  • Execute your java program: java -jar myapp.jar

You could add this steps to yous bash scripts.