Skip to main content

Installing Java

All Flowable products consist of a backend (server-side) and frontend (running in the browser) set of technologies. As such, an installation of Java is always needed on the server where the backend is running.

Originally, Java was created, maintained and released by Sun, which later was acquired by Oracle. In July 2018, Oracle released a subscription-based pricing model for Java SE (Standard Edition) and announced that starting in January 2019, Java SE commercial users must buy a license to receive updates. For servers, the 'JDK' (Java Development Kit) distribution is used. The Oracle JDK LTS (Long Term Support), is released every three years.

There are many alternatives (open-source and propietary) for the JDK. All these JDKs are implemented against a common TCK (Technology Compatibility Kit). An alternative JDK option for example is AdoptOpenJDK which is open source licensed and supports versions for longer, particularly the LTS-marked versions which are currently Java 8, Java 11 and Java 17.

There are many others such as Azul, Amazon Coretto, the Red Hat build of OpenJDK, the Microsoft build of OpenJDK, SAPMachine, and others.

You can install your single preferred Java distribution, or if you wish or need to work with multiple JDKs then there are two alternatives for installing and managing versions: SDKMAN! and Homebrew.

SDKMAN!

SDKMAN! runs on any UNIX based platforms: Mac OSX, Linux, Cygwin, Solaris and FreeBSD and is used to install and manage Software Development Kits (SDKs) like Java.

The first step is to install SDKMAN!.

On Unix platforms simply open a new terminal and enter:

curl -s "https://get.sdkman.io" | bash

Also, then follow the instructions on-screen to complete the installation. Next, open a new terminal window or enter:

source "$HOME/.sdkman/bin/sdkman-init.sh"
note

To install SDKMAN! in Microsoft Windows, see the SDKMAN! Installation page for the details and options.

With the Next to see a list of available JDKs enter:

sdk list java

This shows something similar to:

 ================================================================================
Available Java Versions
================================================================================
12.ea.12-open
11.0.3-open
10.0.2-zulu
10.0.2-open
10.0.2-oracle
9.0.7-zulu
9.0.4-open
8.0.202-zulu
8.0.202-oracle
7.0.202-zulu
1.0.0-rc6-graal

================================================================================
+ - local version
* - installed
> - currently in use
================================================================================

To install Oracle JDK8: sdk install java 8.0.202-oracle and to install OpenJDK 11: sdk install java 11.0.3-open.

To switch between versions use either:

sdk use java 8.0.202-oracle
sdk use java 11.0.3-open

And to set a default version use either:

sdk default java 8.0.202-oracle
sdk default java 11.0.3-open

After setting a default, rerunning the sdk list java command the report looks something like:

 ================================================================================
Available Java Versions
================================================================================
12.ea.12-open
> * 11.0.3-open
10.0.2-zulu
10.0.2-open
10.0.2-oracle
9.0.7-zulu
9.0.4-open
8.0.202-zulu
* 8.0.202-oracle
7.0.202-zulu
1.0.0-rc6-graal

================================================================================
+ - local version
* - installed
> - currently in use
================================================================================

Homebrew for macOS

To install Homebrew option a terminal window and enter:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Detailed instructions and options are found on the installation page for Homebrew.

To install Oracle JDK 8 enter the following:

brew tap caskroom/versions
brew cask install java8

And to install JDK 11 enter:

brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk11

The current list of AdoptOpenJDK version is found here.

To verify the installation and versions, enter:

/usr/libexec/java_home -V
Matching Java Virtual Machines (2):
11.0.3, x86_64: "AdoptOpenJDK 11" /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
1.8.0_202, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home

To manage multiple versions of the JDK there is a tool jEnv that aids in setting the current version of Java.

To install jEnv enter:

brew install jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile

The next step is to make jEnv aware of the versions. First find where the versions are installed using /usr/libexec/java_home -V:

/usr/libexec/java_home -V
Matching Java Virtual Machines (2):
11.0.3, x86_64: "AdoptOpenJDK 11" /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
1.8.0_202, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home

Next add them to jEnv with jenv add:

jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
openjdk64-11.0.3 added
11.0.3 added
11.0 added
macos$ jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home
oracle64-1.8.0.202 added
1.8.0.202 added
1.8 added

The jenv versions command lists the versions jEnv is managing:

jenv versions
* system (set by /Users/dbm/.jenv/version)
1.8
1.8.0.202
11.0
11.0.3
openjdk64-11.0.3
oracle64-1.8.0.202

The jenv global command sets a global version and jenv local sets the JDK version locally, that is, per directory.

jenv global 11.0.3
jenv versions
  system
1.8
1.8.0.202
11.0
* 11.0.3 (set by /Users/dbm/.jenv/version)
openjdk64-11.0.3
oracle64-1.8.0.202