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

Tuesday, 22 October 2024

How to Uninstall JDK 22 on Linux OS or Amazon EC2 | Uninstall JDK 22 on Linux OS or EC2

🚀 Master Cloud & Java!

Join the Ram N Java community for simplified tech tutorials!

CLICK HERE TO SUBSCRIBE

Step-by-Step: Uninstalling JDK 22 on Linux & EC2

Managing your Linux environment efficiently often requires cleaning up older software versions. If you need to remove JDK 22 from your Linux system or an Amazon EC2 instance, this guide provides a clear, foolproof method to get it done correctly.

Step 1: Identify the Installation Path

Before deleting anything, you must know exactly where Java is located. You can find all installed Java versions and their paths by running:

sudo update-alternatives --config java

Look for the path related to JDK 22 (often found in the /opt directory or a custom folder).

Step 2: Remove the JDK 22 Directory

Once you have the path, navigate to that parent directory and use the rm command to delete the folder. For example, if it's in /opt:

sudo rm -rf /opt/jdk-22

Step 3: Clean Up Environment Variables

You likely set up JAVA_HOME in your profile files. You need to remove these lines to avoid system errors. Open your profile file (like /etc/profile or ~/.bashrc):

sudo nano /etc/profile

Find the lines referencing JDK 22, delete them, save the file, and then reload the variables:

source /etc/profile

Step 4: Update the Alternatives System

If you manually added JDK 22 to the Linux alternatives system, remove the entries for java and javac using:

sudo update-alternatives --remove "java" "/opt/jdk-22/bin/java"
sudo update-alternatives --remove "javac" "/opt/jdk-22/bin/javac"

Step 5: Verify the Uninstallation

Finally, confirm that JDK 22 is gone by checking the version:

java -version

If it was your only Java version, you will see a "command not found" error, confirming a successful removal!

📥 Get the Presentation & Code!

I provide the PowerPoint slides and source code for all my tutorials. You can find the download links directly in the description of the YouTube video above!

Wednesday, 16 October 2024

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

🚀 Level Up Your Tech Skills!

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

SUBSCRIBE TO OUR CHANNEL

How to Install JDK 22 on Linux or Amazon EC2

Setting up JDK 22 on a Linux server or an Amazon EC2 instance is a fundamental step for Java developers. This guide provides a clear, step-by-step terminal process to get your environment ready for development.

Step 1: Update Your System

Always start by ensuring your package lists and installed packages are up to date. Run these commands in your terminal:

sudo yum update -y
sudo yum upgrade -y

Step 2: Download the JDK 22 Package

Download the Linux x64 Compressed Archive from the Oracle website using the wget command. This will pull the .tar.gz file directly to your server.

wget [DOWNLOAD_LINK_FOR_JDK_22]

Step 3: Extract to /opt Directory

Once downloaded, extract the archive into the /opt directory, which is a standard location for optional software:

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

Step 4: Configure Environment Variables

To use Java from any directory, update your /etc/profile file to include JAVA_HOME and update the PATH:

export JAVA_HOME=/opt/jdk-22.0.1
export PATH=$PATH:$JAVA_HOME/bin

Apply the changes immediately with: source /etc/profile

Step 5: Verify Your Installation

Finally, check that Java and the Java compiler are correctly installed and pointing to version 22:

java -version
javac -version

📥 Download Free Resources!

You can find the PowerPoint presentation and Java source code used in this tutorial in the YouTube video description above. Happy coding!

Saturday, 21 September 2024

How to Install JDK 22 on Windows OS: Step-by-Step Guide | Java JDK 22 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 22 on Windows

The Java Development Kit (JDK) is the backbone of Java programming. Whether you're a student or a pro, having the right version installed correctly is key. In this guide, we walk through the installation of JDK 22 on Windows 11, ensuring your environment is ready for action.

1. Download the JDK

Go to the official Oracle website and download the x64 Installer for Windows. This file contains everything you need to develop and run Java applications on your PC.

2. Easy Installation

Run the downloaded file and follow the prompts. The default location is usually C:\Program Files\Java\jdk-22. It's best to stick with this to avoid confusion later!

3. Setting Environment Variables

To use Java from your command prompt, you need to tell Windows where it is:

  • Open System Environment Variables.
  • Add a new variable JAVA_HOME pointing to your JDK folder.
  • Update the Path variable by adding the bin folder inside your JDK.

Level Up with Ram N Java!

Check out these other advanced guides to boost your developer skills:

Tutorials