Java

This article will show you how to install a version of Java to your slot for use with applications. There is a version installed server-wide, but some apps require a newer version.

You'll need to execute some commands via SSH to use this software. There is a separate guide on how to connect to your slot via SSH. Commands are kept as simple as possible and in most cases will simply need to be copied and pasted into the terminal window (then executed by pressing the Enter key).

Table of contents

Installation

Install Java by logging in via SSH, then copying and pasting the following:

mkdir -p ~/bin && bash
wget -qO ~/java.tar.gz https://javadl.oracle.com/webapps/download/AutoDL?BundleId=239848_230deb18db3e4014bb8e3e8324f81b43
tar xf ~/java.tar.gz --strip-components=1 -C ~/
rm ~/java.tar.gz

Installation notes

Java versions are downloaded using a BundleID number that corresponds to a specific version. It's therefore not possible to provide a link which would always download the most up-to-date version. Feel free to contribute to this page by updating bearing in mind the following requirements:

URL
https://www.java.com/en/download/linux_manual.jsp
Version
Linux x64

The RPM versions (64-bit or otherwise) and the non-x64 version will not work with the listed steps.

Using Java

You can check the version of Java your user is running (or, more accurately, can run when called by other software) with the following command:

~/bin/java -version

Java is used by a number of other apps and specific configuration instructions should therefore be sought on the app's pages.

Troubleshooting

When I try to run the version command I get No such file or directory even though the file is clearly there

The most likely answer to this is that you downloaded the Linux version rather than the Linux x64 version. Whilst for some legacy reasons some servers may still have 32-bit support, the majority do not and this will not be added. Please make sure you're using the x64 version.

Uninstallation

rm ~/bin/java ~/javaws