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

Sunday, 20 October 2024

How to Uninstall JDK 11 on Linux OS (Amazon EC2) | Uninstalling JDK 11 on Linux OS (Amazon EC2)

🚀 Master Java & AWS!

Subscribe to Ram N Java for simplified, high-quality tech tutorials!

YES, I WANT TO SUBSCRIBE

How to Uninstall JDK 11 on Linux or Amazon EC2

Cleaning up your development environment is just as important as setting it up! If you need to remove JDK 11 from your Linux machine or Amazon EC2 instance to make room for a newer version, this guide will walk you through the process step-by-step using simple terminal commands.

Step 1: Check Currently Installed Java Versions

Before you start deleting, it's a good idea to see exactly what you have installed. Run the following command in your terminal:

sudo update-alternatives --config java

This will list all Java paths. Take note of the path where JDK 11 is installed (e.g., /usr/lib/jvm/java-11-amazon-corretto).

Step 2: Uninstall Using the Package Manager

If you installed Java using a package manager like yum (common on Amazon Linux/CentOS) or apt (Ubuntu), you can remove it easily:

  • For Amazon Linux/CentOS: sudo yum remove java-11-amazon-corretto-devel
  • For Ubuntu/Debian: sudo apt-get remove openjdk-11-jdk

Step 3: Clean Up Environment Variables

If you manually set up your JAVA_HOME path, you must remove it to avoid errors. Open your profile file:

sudo nano /etc/profile

Find the lines related to JDK 11, delete them, and save. Then, reload the file:

source /etc/profile

Step 4: Verify the Removal

Confirm that JDK 11 is gone by running the version check command:

java -version

If it was your only version, the system will tell you the command is not found. If you have other versions, it will show the next active one.

💡 Need Resources?

Don't forget that I share the PowerPoint presentation and source code for all my tutorials! You can find the download links in the YouTube video description above.

Tuesday, 15 October 2024

JDK 11 Installation on Linux OS and Amazon EC2 Explained | Running JDK 11 on AWS EC2 or Linux OS

Join the Ram N Java Community! 🚀

Subscribe to get the latest Java, AWS, and Cloud tutorials delivered straight to you!

SUBSCRIBE ON YOUTUBE

Overview

Installing Java Development Kit (JDK) 11 on an Amazon EC2 instance or any Linux-based server is a fundamental step for Java developers. This guide will walk you through the process, from updating your system to verifying your installation.

Step 1: Update Your Linux System

Before installing any new software, it is a best practice to ensure your existing packages are up to date. This minimizes compatibility issues.

sudo yum update
sudo yum upgrade

Step 2: Download the JDK 11 Archive

Visit the Oracle JDK 11 download page and locate the Linux 64 compressed archive (ending in .tar.gz). You can download it directly to your server using wget or download it locally and transfer it via WinSCP.

  • Using WinSCP: Log in to your EC2 instance and drag the downloaded .tar.gz file into your home directory (e.g., /home/ec2-user).

Step 3: Extract JDK to /opt Directory

The /opt directory is a standard location for optional software packages. Extract your archive there:

sudo tar -xvf jdk-11.0.x_linux-x64_bin.tar.gz -C /opt

Verify the extraction by listing the contents of /opt:

ls /opt

Step 4: Set Environment Variables

To make Java available system-wide, you must configure the JAVA_HOME and PATH variables. Open the global profile file:

sudo nano /etc/profile

Scroll to the bottom and add these lines (ensure the path matches your extracted version):

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

Save (Ctrl+X, then Y, then Enter) and refresh your session:

source /etc/profile

Step 5: Verify Installation

Confirm that JDK 11 is correctly installed and active:

java -version
javac -version

You should see output indicating "java version 11.x.x".

Conclusion

Congratulations! You have successfully configured JDK 11 on your Amazon EC2 instance. You are now ready to run Java applications or set up a build environment for your projects.

Thursday, 19 September 2024

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

🚀 Start Your Java Journey! 🚀

Setting up for a project or learning the basics? Join the Ram N Java family for more simple tech guides and professional Java insights!

SUBSCRIBE TO THE CHANNEL

Setting Up Java JDK 11 on Windows

Java JDK 11 is a widely used Long-Term Support (LTS) version, essential for many enterprise applications and legacy projects. Getting it installed correctly on Windows 11 is the first step toward building stable software. This guide covers everything from the initial download to final verification.

1. Finding the Right Installer

Head to the official Oracle website and look for the JDK 11 downloads. You'll need to select the Windows x64 Installer. This executable file makes the setup process smooth by installing the development kit directly into your system files.

2. Step-by-Step Installation

Launch the installer and follow the on-screen instructions. The default path is usually C:\Program Files\Java\jdk-11. We recommend keeping this default path as it makes it much easier to configure your developer tools later on.

3. Configuring System Variables

To ensure Java commands work in your terminal, you must update your System Environment Variables.

  • Search for "Edit the system environment variables" in your Start menu.
  • Under "System Variables," find Path and click Edit.
  • Add a new entry pointing to the bin folder inside your JDK 11 installation.
  • Test it by opening a new Command Prompt and typing java -version.

Keep Growing with Ram N Java!

Ready for more? Explore these essential tech and development guides:

Tutorials