Java is required for running some PC games on your Linux web server including Minecraft. The object-oriented programming language powers many websites and applications on computers and mobile devices. Below we cover how to install Java on your CentOS VPS.
You need root access to your VPS / Dedicated server to continue.
The installation process consists of installing OpenJDK, the open source Java implementation which includes Font Renderer, or proprietary Oracle JRE/JDK with Flight Recorder which builds on top of OpenJDK.
We recommend OpenJDK for the latest features. You may prefer Oracle JRE/JDK for stability.
- Log into SSH as root
- Search for the latest Java version:
yum search openjdk
- Install the latest version:
yum install java-11-openjdkas of January 28, 2020
- If you see the following the command afterwards, run
yum-complete-transaction --cleanup-only, then
yum history redo lastto finish incomplete commands:
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
Install Oracle JRE/JDK
- Visit https://www.oracle.com/technetwork/java/javase/downloads/
- Select Download for the latest Java SE version (version 13.0.2 as of January 28, 2020)
- Download the Linux RPM package
- (Optional) Verify the SHA256 checksum on your Windows, Mac, or Linux machine against the checksum
- Upload the RPM file package to your server via cPanel, FTP, or SSH (required on Cloud VPS)
- Install the RPM package as user root:
yum install /path-to-file/jdk-[version].rpm
Check Java Version
Check your Java status to ensure it’s installed correctly:
You should see similar results to below:
java version "13.0.2" 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Only pay for what you need with our tiered pricing options for Cloud VPS Hosting.