JDK vs JRE: What to Install
Two commands for the default JDK:
sudo apt update && sudo apt install default-jdk -y— installs Ubuntu's preferred OpenJDK (Java 21 LTS on modern releases).java -versionto verify, plusjavac -version— the compiler's presence confirms a full JDK, not a bare JRE.
JDK versus JRE, the choice that prevents reinstalling later: the JRE runs Java programs; the JDK adds the compiler and development tools. Running applications needs only the headless JRE (openjdk-21-jre-headless — no GUI libraries, ideal for servers); building or deploying Tomcat-class apps needs the JDK.
Installing the Default JDK via apt
Installing the Default JDK via apt. Do the change this heading names on one site first, then check it in a private browser window or in the mail client, depending on the topic. Change one setting at a time, and undo it if the result is wrong before you try the next. If you want the Jaipur desk to look with you, email support@webji.services — that mailbox is staffed 24/7 in Hindi and English. Phone +91 141 4941811 is business hours only.

Installing Specific Versions (17, 21, headless)
Installing Specific Versions (17, 21, headless). Do the change this heading names on one site first, then check it in a private browser window or in the mail client, depending on the topic. Change one setting at a time, and undo it if the result is wrong before you try the next. If you want the Jaipur desk to look with you, email support@webji.services — that mailbox is staffed 24/7 in Hindi and English. Phone +91 141 4941811 is business hours only.
Verifying the Installation
Verifying the Installation. Do the change this heading names on one site first, then check it in a private browser window or in the mail client, depending on the topic. Change one setting at a time, and undo it if the result is wrong before you try the next. If you want the Jaipur desk to look with you, email support@webji.services — that mailbox is staffed 24/7 in Hindi and English. Phone +91 141 4941811 is business hours only.
Setting JAVA_HOME Permanently
JAVA_HOME is the environment variable build tools (Maven, Gradle, Tomcat wrappers, systemd services) read:
- Find your exact path:
ls /usr/lib/jvm/— e.g./usr/lib/jvm/java-21-openjdk-amd64. - Set it system-wide: edit
/etc/environmentand addJAVA_HOME="/usr/lib/jvm/java-21-openjdk-amd64". - Per-user alternative: append the export line to
~/.bashrc, thensource ~/.bashrc. - Verify with
echo $JAVA_HOMEin a fresh shell.
Switching versions later is update-alternatives' job — sudo update-alternatives --config java lists installed JREs; pick a number and the default moves without touching JAVA_HOME.
Not connected yet? The PuTTY guide covers the first login.
Switching Default Versions with update-alternatives
On update-alternatives version switching, the honest summary is that defaults matter more than brand names — a well-set budget plan outranks a mis-tuned premium one. WebJi® documents its defaults openly and adjusts them per ticket when workloads need it.
Server Tips: Headless JRE and Memory Settings
How this plays out with java -version verification: settings that look cosmetic usually decide page speed and uptime under real traffic. The defaults WebJi® ships are tuned for Indian network conditions, and support can review your setup on request.
Frequently Asked Questions
How do I install Java on Ubuntu 24.04?
sudo apt update && sudo apt install default-jdk -y — installs Ubuntu's preferred OpenJDK (Java 21 LTS on modern releases).
What is the difference between JDK and JRE?
java -version to verify, plus javac -version — the compiler's presence confirms a full JDK, not a bare JRE.
How do I install a specific version like Java 17 or 21?
sudo apt update && sudo apt install default-jdk -y — installs Ubuntu's preferred OpenJDK (Java 21 LTS on modern releases). The question here is: How do I install a specific version like Java 17 or 21.
How do I set JAVA_HOME on Ubuntu?
sudo apt update && sudo apt install default-jdk -y — installs Ubuntu's preferred OpenJDK (Java 21 LTS on modern releases). The question here is: How do I set JAVA_HOME on Ubuntu.
How do I switch between installed Java versions?
Switching versions later is update-alternatives' job — sudo update-alternatives --config java lists installed JREs; pick a number and the default moves without touching JAVA_HOME.
How do I check which Java version is active?
java -version to verify, plus javac -version — the compiler's presence confirms a full JDK, not a bare JRE. The question here is: How do I check which Java version is active.
Is WebJi® an Indian company?
Yes. WebJi® is headquartered in Jaipur, Rajasthan and has operated since 2005. Billing, support and governance all run from India.
Do you provide GST invoices?
Every purchase and renewal gets a GST invoice with our GSTIN, and hosting prices are quoted exclusive of 18% GST. Claim input credit as applicable.

