Java is required for running some 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 CentOS
- Check Java Download Version
- Uninstall Java
You need root access to your VPS / Dedicated server to continue.
Install Java on CentOS
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. As of as of January 25, 2021:
yum install java-11-openjdk
- You may see the following command afterwards:
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).
If so, run the following to finish incomplete commands:
yum history redo last
Install Oracle JRE/JDK
- Visit https://www.oracle.com/java/technologies/javase-downloads.html
- Select JDK Download for the latest Java SE version (version 15 as of January 25, 2021)
- Download the Linux RPM package
- (Optional) Verify the SHA256 checksum of the downloaded file on your Windows, Mac, or Linux machine against the checksum on the downloads page
- Upload the RPM file package to your server via cPanel, FTP, or SSH
- Install the RPM package as user root:
yum install /path-to-file/jdk-[version].rpm
Check Java Download Version
Check your Java status to ensure it’s installed correctly:
You should see similar results to below:
If you don’t need cPanel, don't pay for it. Only pay for what you need with our Cloud VPS solutions.
CentOS, Debian, or Ubuntu No bloatware SSH Key management made easy
Learn more about managing your Linux server with our Managed VPS Hosting Product Guide.