How to install Java on the Sandbox VM


#1

Installing JAVA on the Sandbox VM can be done as follows:

  1. Login to the Sandbox VM (e.g. using putty)

  2. Go to the directory where you want to install Java (e.g. /home/some_user):

cd /home/some_user

c) Download the latest version of Java

wget --no-cookies --no-check-certificate --header “Cookie: gpw_e24=http://www.oracle.com; oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

d) Unzip the file

tar xzf jdk-8u131-linux-i586.tar.gz

e) Setup some environment variables:

export JAVA_HOME=/home/some_user/jdk1.8.0_131
export JRE_HOME=/home/some_user/jdk1.8.0_131/jre
export PATH=/home/some_user/jdk1.8.0_131/bin:/home/some_user/jdk1.8.0_131/jre/bin:$PATH

The above environment variables have to be defined each time you open a new connection with your Sandbox VM. If you want to set these env. variables automatically each time you login to the Sandbox VM, you have to add the “export” commands above in the "/home/some_user/.bashrc” file.

f) Test your installation by executing a jar file

java –jar my_jar.jar


#2

Thank you @vroeyt, this is indeed a way to install the Oracle Java Platform 1.8 on the sandbox.
Nevertheless, we recommend using the dedicated packages using YUM package manager if your processor is not strictly bond to that java distribution.

by default, the OpenJDK Runtime Environment 1.7.0 is installed but you can change that version for 1.8.0 as well by entering the following command:

sudo yum install java-1.8.0-openjdk

This enables the system to trace all the installed software during you service integration and thus ensure a that installed software via YUM will be packaged along your processor workflow and then deployed properly in production. Furthermore, installing software in your home for being used at runtime by your workflow is not recommended since all installed software out of the application repository folder is not packaged by default. So please be careful when installing third party software in the home directory.

All packages can be easily searched by keywords, for instance:

yum search jdk

it returns the related packages available.

======================================================================================
copy-jdk-configs.noarch : JDKs configuration files copier
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-debug.x86_64 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.8.0-openjdk-demo-debug.x86_64 : OpenJDK Demos with full debug on
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-devel-debug.x86_64 : OpenJDK Development Environment with full debug on
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-headless-debug.x86_64 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-javadoc-debug.noarch : OpenJDK API Documentation for packages with debug on
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk-src-debug.x86_64 : OpenJDK Source Bundle for packages with debug on
ldapjdk-javadoc.x86_64 : Javadoc for ldapjdk
icedtea-web.x86_64 : Additional Java components for OpenJDK - Java browser plug-in and Web Start implementation
jdk.x86_64 : Java(TM) Platform Standard Edition Development Kit
ldapjdk.x86_64 : The Mozilla LDAP Java SDK