Navigation:  Pre-required activities > Environment configuration >

Java OpenJDK JRE installation

Previous  Top  Next

To install Java OpenJDK JRE, execute the following steps:

 

1.Access the src folder and decompress Java in the /usr/local/se/apps/java directory:

# cd /usr/local/se/src

# mkdir /usr/local/se/apps/java

# tar -zxvf OpenJDK8U-jre_x64_linux_hotspot_8u322b06.tar.gz -C /usr/local/se/apps/java

 

2.Execute the Java installation:

For CentOS/RedHat

# alternatives --install /usr/bin/java java /usr/local/se/apps/java/jdk8u322-b06-jre/bin/java 2

For Debian/SUSE

# update-alternatives --install /usr/bin/java java /usr/local/se/apps/java/jdk8u322-b06-jre/bin/java 2

 

3.After installing Java, it is necessary to create the JAVA_HOME environment variable. To create the JAVA_HOME variable, execute the following command:

For CentOS/RedHat

# echo 'export JAVA_HOME=/usr/local/se/apps/java/jdk8u322-b06-jre' >> /etc/bashrc

# source /etc/bashrc

For Debian/SUSE

# echo 'export JAVA_HOME=/usr/local/se/apps/java/jdk8u322-b06-jre' >> /etc/profile

# source /etc/profile

ATTENTION!

Before creating the environment variable, check if other applications installed on the same server also use it, because that can affect the operations of these applications. If needed, check the possibility of creating the variable for a user or application profile.