How to Install Java on Ubuntu 24.04 | OpenJDK & Oracle JDK

Опубликовано: 29 Март 2026
на канале: LinuxTechi
247
4

📌 Learn how to install Java on Ubuntu 24.04 step-by-step! In this tutorial, we cover both OpenJDK and Oracle JDK installations, setting up the JAVA_HOME environment variable, and running a Java Hello World program. Whether you're a developer or a system administrator, this guide will help you choose and install the best Java version for your needs.

🔹 Topics Covered:
✅ Install OpenJDK on Ubuntu 24.04 (Recommended for most users)
✅ Install Oracle JDK on Ubuntu 24.04 (For enterprise applications)
✅ Set JAVA_HOME Environment Variable
✅ Compile & Run a Java Hello World Program

📢 Commands Used in the Video:

sudo apt update && sudo apt upgrade -y
sudo apt install default-jdk -y
java --version
sudo apt install ./jdk-23_linux-x64_bin.deb -y
sudo update-alternatives --config java
sudo vi /etc/environment
echo $JAVA_HOME
javac HelloWorld.java
java HelloWorld

🔗 More Linux Tutorials:    • Linux Tutorials  

🔥 Subscribe for More Linux & DevOps Tutorials!

📢 Have questions or need help? Drop a comment below! 👇

#Java #Ubuntu24 #OpenJDK #OracleJDK #LinuxTutorial #JavaInstallation #JavaOnLinux 🚀