🚀 Master Java & Cloud!
Subscribe to Ram N Java for the most simplified tech tutorials!
SUBSCRIBE TO OUR CHANNELHow 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 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.
Step 3: Extract the Archive
The standard practice is to install optional software in the /opt directory. Extract your downloaded .tar.gz file there:
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 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:
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.
This is the best blog design and article. Very nice job. Thank you very much...
ReplyDeleteBest python full stack training in hyderabad