/ Installation  

A few quick tips to help you install Java

Hi there AppWorks fans,

Welcome to a new installment of AppWorks tips.

This guide will help you installing OpenJDK Java on our CentOS VM image. Easy stuff, but always nice to see how smooth this goes.

This post is part of the series for ‘AppWorks installation in 10 great steps’.

This is the list of ingredients we are going to use:

  • The already installed ‘Oracle Virtual Box’ software from the previous post
  • Our brand-new CentOS VM image from the previous post
  • PuTTY (SSH client). Downloaded from putty.org

Let get right into it…

First thing to do is open the Oracle VM VirtualBox tooling and start-up our image. Leave the image as is because we can make a connection with PuTTY. Login with the created ‘otadmin’ user. Password used as an example: ‘admin’

Once the connection is made, we need to install OpenJDK first as it is required to run TomEE. But what version is required? This can again be found in the ‘AppWorks Platform Supported Environments’ documentation that can be found on the support site from OpenText.

The documentation tells us to install Java 8 update 60

general_001

So, from your terminal screen give the command: sudo yum -y install java-11-openjdk-devel

When done you should have java available by the command: java -version

You will get this information back:

1
2
3
openjdk version "11.0.3" 2019-04-16 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.3+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.3+7-LTS, mixed mode, sharing)

To make it nicer and smoother we will create a new variable JAVA_HOME (and some others!). So, edit the ~/.bash_profile of the ‘otadmin’ user: vi ~/.bash_profile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

JAVA_HOME=/usr/lib/jvm/java-11-openjdk
LIB_PATH=/usr/lib/jvm/java-11-openjdk/lib/server/
PATH=$PATH:$HOME/.local/bin:$HOME/bin:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB_PATH

export JAVA_HOME
export PATH
export LD_LIBRARY_PATH

Quick vi-reference

  • Hit <Insert> to start making changed
  • Hit <Esc> to stop making changed
  • To save the file (after <Esc>) type: :w
  • To quit the file (after <Esc>) type: :q

When done reload your profile via the command: source ~/.bash_profile

Check if it’s all OK via: env | grep java


That’s again a nuckle-bumb ‘DONE’. Good job for this post! The next step in the series for ‘AppWorks installation in 10 great steps’ we’ll install the TomEE application server. Have a good one for now and I’ll see you in the next post.