Back to all guides
Server Setup

How to Install Java on Your Server

4 read2025-05-25

Java is one of the most popular programming languages and is required for many applications. With Ryzehosting, we've made Java installation incredibly simple with our automated installer tool.

Quick Installation

We provide an easy-to-use installer script that handles everything for you. Simply run this command on your server:

bash
bash <(curl -s https://raw.githubusercontent.com/RyzehostingNET/java-installer/main/setup.sh)

Using the Installer

After running the command, you'll see a menu with these options:

text
0) install Java
1) change Java (version)
2) do nothing (exit)

Use your arrow keys to navigate and press Enter to select.

Available Java Versions

When you select "install Java" (option 0), you can choose from these versions:

text
0) Java 8
1) Java 11
2) Java 16
3) Java 17
4) Java 18
5) Java 19
6) Java 20
7) Java 21
8) Java 22
9) Java 23
10) Java 24

Simply use the arrow keys to select your desired version and press Enter. The script will automatically:

  • Download the correct Java version
  • Install all necessary dependencies
  • Configure environment variables
  • Set up JAVA_HOME properly

Manual Installation (Alternative)

If you prefer to install Java manually, here are the traditional steps:

Prerequisites

Before installing Java manually, ensure you have:

  • Administrative access to your server
  • A stable internet connection
  • At least 1GB of available disk space

Step 1: Update Your System

First, update your package manager:

bash
sudo apt update && sudo apt upgrade -y

Step 2: Install Java Manually

Option 1: Install OpenJDK (Recommended)

bash
sudo apt install openjdk-11-jdk -y

Option 2: Install Oracle JDK For Oracle JDK, you'll need to download it manually from Oracle's website.

Step 3: Verify Installation

Check if Java is properly installed:

bash
java -version
javac -version

Step 4: Set JAVA_HOME

Add JAVA_HOME to your environment variables:

bash
echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64' >> ~/.bashrc
source ~/.bashrc

Troubleshooting

If you encounter issues with the automated installer:

  • Ensure you have internet connectivity
  • Check if you have sufficient permissions (run as root if needed)
  • Verify that curl is installed on your system

For manual installation issues:

  • Ensure you have sufficient permissions
  • Check if the Java version is compatible with your application
  • Verify that JAVA_HOME is correctly set

Next Steps

Now that Java is installed, you can:

  • Deploy Java applications like Minecraft servers
  • Configure application servers like Tomcat
  • Set up development environments
  • Run Java-based web applications

Why Use Our Automated Installer?

  • Fast: Installation completes in under 2 minutes
  • Reliable: Tested across multiple Linux distributions
  • Multiple Versions: Support for Java 8 through 24
  • Automatic Configuration: No manual environment setup needed
  • Easy Switching: Change Java versions anytime
KVM Linux VPS

Looking for the right Linux VPS?

Put your project into practice right away: Our KVM VPS provide full root access, lightning-fast NVMe storage, and reliable KVM isolation. Flexible prepaid billing with no subscription and personal Discord support.

Full Root Access (SSH)
Datacenter NVMe SSD
4+ Tbps DDoS Protection
100% Prepaid (No Subscription)