Table of Contents
Java is a popular programming language used for developing desktop applications, web applications, and enterprise software.
Step 1: Update Your System
Before installing Java on Debian 13, update your package list to make sure your system has access to the latest available packages.
sudo apt update
sudo apt upgrade -y
Step 2: Check Available Java Packages
Debian 13 supports OpenJDK packages through its official repositories. Check the available Java Development Kit packages before installation.
apt search openjdk
Step 3: Install Java Development Kit (JDK)
Install OpenJDK 21, which is available in the Debian 13 stable repositories. The JDK includes everything needed to develop and run Java applications.
sudo apt install openjdk-21-jdk -y
Step 4: Install Java Runtime Environment
The Java Runtime Environment allows you to run Java applications without needing the full development tools. If you installed the JDK in the previous step, a separate JRE installation is generally unnecessary.
sudo apt install default-jre -y
Step 5: Check the Java Version
After installing Java, check the installed version to make sure the installation was completed successfully.
java -version
Step 6: Check the Java Compiler
The Java compiler is included in the JDK and is required to compile Java source files.
javac -version
Step 7: Locate the Java Installation
Check the OpenJDK installation directory on Debian 13 to find the installed Java version and confirm where its files are stored
ls /usr/lib/jvm/
Step 8: Check Available Java Versions
If multiple Java versions are installed on your system, you can view the available versions and select the default Java installation.
sudo update-alternatives --config java
Step 9: Verify the Java Installation
Run the following commands to confirm that both Java and the Java compiler are available and working correctly.If both commands display version information, Java has been successfully installed on Debian 13.
java -version
Follow DropVPS on Google
Add DropVPS as a preferred source to see our latest VPS guides and tutorials surfaced first in Google Search and AI Overviews.
Need a Linux Server for This?
Run Debian, Ubuntu, or any Linux distro on DropVPS โ fast NVMe SSD, full root access, and 24/7 support. Perfect for everything you just read.
- Full Root Access
- Debian & Ubuntu Ready
- 99.99% Uptime
- 24/7 Support
No commitment ยท Cancel anytime
