Showing posts with label JDK 21. Show all posts
Showing posts with label JDK 21. Show all posts

Friday, 18 October 2024

How to Uninstall JDK 21 on Linux OS or Amazon EC2 | Uninstalling JDK 21 on Linux and EC2 Instances

🚀 Master Cloud Computing!

Subscribe to Ram N Java for simplified AWS and Java tutorials!

SUBSCRIBE TO OUR CHANNEL

How to Uninstall JDK 21 on Linux or Amazon EC2

Removing JDK 21 from your Linux environment or an Amazon EC2 instance is a necessary step when you're upgrading or troubleshooting. This guide provides the exact terminal commands to ensure a clean and successful removal.

Step 1: Verify the Active Java Version

Before proceeding, check if JDK 21 is currently installed on your system by running:

java -version

Step 2: Locate the Installation Path

If you have multiple Java versions, use this command to find where JDK 21 is located:

sudo update-alternatives --config java

Note down the directory path (e.g., /usr/lib/jvm/java-21-amazon-corretto).

Step 3: Uninstall the JDK Package

Based on your Linux distribution, use the appropriate command to remove the package:

  • For Amazon Linux/CentOS (YUM): sudo yum remove java-21-amazon-corretto-devel
  • For Ubuntu/Debian (APT): sudo apt-get remove openjdk-21-jdk

Step 4: Clean Up Environment Variables

Don't forget to remove the JAVA_HOME path from your profile settings to avoid system errors. Open the file:

sudo nano /etc/profile

Find and delete any lines referencing JDK 21, save the file, and then refresh your environment using: source /etc/profile

Step 5: Final Verification

Run the version check one last time. If uninstalled correctly, the system will either show another version or a "command not found" error.

📥 Download the Slides & Code!

I make the PowerPoint presentation and source code available for all my viewers! You can find the direct download links in the description of the YouTube video above.

Tuesday, 15 October 2024

How to Install JDK 21 on Linux and Amazon EC2 | JDK 21 Installation on Linux OS or Amazon EC2

🚀 Master Java & Cloud!

Subscribe to Ram N Java for the most simplified tech tutorials!

SUBSCRIBE TO OUR CHANNEL

How to Install JDK 21 on Linux or Amazon EC2

Setting up JDK 21 (a Long-Term Support version) on a Linux server or an Amazon EC2 instance is a core requirement for building modern, robust Java applications. This guide will walk you through the entire process step-by-step.

Step 1: System Update

Before any installation, it's vital to update your package repository to ensure system stability. Run the following commands:

sudo yum update -y
sudo yum upgrade -y

Step 2: Download JDK 21

Use the wget command to download the Linux x64 Compressed Archive directly from the Oracle website. This allows you to choose exactly where the JDK will reside.

wget [PASTE_JDK_21_DOWNLOAD_LINK_HERE]

Step 3: Extract the Archive

The standard practice is to install optional software in the /opt directory. Extract your downloaded .tar.gz file there:

sudo tar -xvf jdk-21_linux-x64_bin.tar.gz -C /opt

Step 4: Configure Path & Environment

To access Java from any terminal window, you need to set the JAVA_HOME and update your PATH variable in the /etc/profile file:

export JAVA_HOME=/opt/jdk-21.x.x
export PATH=$PATH:$JAVA_HOME/bin

Apply these changes by running: source /etc/profile

Step 5: Verify Your Setup

Confirm that everything is configured correctly by checking the version:

java -version
javac -version

📥 Download Free Resources!

I share the PowerPoint presentation and full source code for every tutorial! Head over to the YouTube video description to find the download links.

Thursday, 19 September 2024

How to Install JDK 21 on Windows OS: Step-by-Step Guide | Java JDK 21 Installation on Windows 11

🚀 Start Your Coding Journey! 🚀

Ready to build your first Java application? Join the Ram N Java family for simple, step-by-step tech guides and professional Java insights!

SUBSCRIBE TO THE CHANNEL

Setting Up Java JDK 21 on Windows

The Java Development Kit (JDK) 21 is a powerful Long-Term Support (LTS) release, essential for developers who value stability and modern features. Getting it installed correctly on Windows 11 is the foundation of your Java development environment. In this guide, we make the process easy and foolproof!

1. Downloading the Installer

First, head over to the official Oracle website. You’ll want to download the x64 Installer for Windows. This is a simple executable file that handles the heavy lifting of placing the necessary Java files on your system.

2. The Installation Process

Once the download is complete, run the installer. The default installation path is usually C:\Program Files\Java\jdk-21. We recommend keeping this path as it is, as it makes setting up your environment variables much easier in the next step!

3. Configuring Environment Variables

This is the step where your computer learns where to find Java. To make Java work from any command prompt, you must add the "bin" folder of your JDK to the System Path.

  • Open Edit the system environment variables.
  • Click Environment Variables.
  • Under System Variables, find Path and click Edit.
  • Add a new entry pointing to your JDK bin folder.

Keep Exploring with Ram N Java!

Master more tech and AI skills with these top tutorials:

Tutorials