If you don’t already have a JDK installed, you’ll need to download and install one before you can deploy Payara Server. We recommend Zulu®, an OpenJDK that is fully compliant with the Java SE standard, 100% open source, and can be downloaded and used for free. Also, should you ever purchase support for the Payara Platform, support for Zulu OpenJDK is included.
Download Zulu OpenJDK from their website: https://www.azul.com/downloads/zulu/
We’ve created a video tutorial to show you how to install the OpenJDK:
Or, if you prefer to follow written instructions:
- First, check to see if there is already a JDK installed.
- Open the terminal window and type:
If it says ‘javac’ not found, it can be installed.
- Open the Zulu JDK install guide from here: https://www.azul.com/files/zulu_8.9_install.pdf
- Click on the Installation on Linux Using a Yum or APT Repository in the table of contents.
- Click on the link: Preparing the Zulu Installation Platform.
- Click on the link in #3 of the guide: Attach the Azul package repository. If you are using a yum or APT repository, complete the steps in: Attach Azul Package Repositories.
- This page offers two sections, one for Yum and one for APT. You will be following the APT section: Attach the APT Repository on an Ubuntu or Debian System.
- You can copy the commands provided in the guide directly into your terminal, one command at a time. Type them exactly as provided as if you copy from the PDF and paste into terminal, the formatting from the PDF will cause problems.
- The sudo command requires a password.
- After the commands have been entered, you’ll need to do an app update (Step 4 in the Attach the APT Repository instructions).
- Go back to the table of contents in the Zulu guide: https://www.azul.com/files/zulu_8.9_install.pdf
- Under “Installing Zulu” choose the correct APT command for installation. For example, we used the command for installing Zulu for Ubuntu or Debian. Enter the command into your terminal.
- Copy the first part of the path that appears on your terminal screen:
· In terminal, type
cd /usr/lib/jvm/zulu-8 -amd64 (or whatever install path you copied from the terminal in the last step)
- In terminal, type ls
This shows us where the JDK has been installed. Next, we’ll follow the Post Installation Tasks.
Post Installation Tasks
First, we’ll verify the installation.
- Follow the links in the Zulu Guide under Post Installation Tasks for verifying installation on your machine (Windows, Linux, etc). https://www.azul.com/files/zulu_8.9_install.pdf
- Type the command into terminal It will show you the OpenJDK Environment and the version installed: Java -version
- Next, we will set the java_home environment variable. Check if it is there with the echo command in terminal: echo $JAVA_HOME
- If it prints nothing, it has not been set yet.
- To set the Java_Home environment variable: Copy the file path again from the terminal screen – ours was /usr/lib/jvm/zulu-8-amd64
- Type: nano ~/.bash
- Type: nano ~/.bashrc
- Scroll to the end of the file in your terminal window. Type the export command with the file path you copied previously:
- Save and exit
- Type: source ~/.bashrc
- Type: echo $Java_Home
- You should see the installation path displayed.
- Type: javac -version
- Type: java -version
You should now see the OpenJDK Runtime Environment has been successfully installed!