🚀 Master Java & AWS!
Subscribe to Ram N Java for the most simplified tech tutorials!
SUBSCRIBE TO OUR CHANNELHow to Install JDK 23 on Linux or Amazon EC2
Setting up JDK 23 on a Linux server or an Amazon EC2 instance is a core skill for any developer. This guide will walk you through the process step-by-step, from updating your system to verifying your installation.
Step 1: Update Your Linux System
Before installing new software, it's a best practice to ensure your existing packages are up to date. Run these commands in your terminal:
sudo yum upgrade -y
Step 2: Download the JDK 23 Archive
Visit the Oracle JDK download page and copy the link for the Linux x64 Compressed Archive. Then, use the wget command to download it directly to your server:
Step 3: Extract the JDK
Once the download is complete, extract the files to the /opt directory, which is the standard place for optional software packages:
Step 4: Set Environment Variables
To make Java available system-wide, you need to set the JAVA_HOME and PATH variables. Open the /etc/profile file:
Add these lines at the end of the file:
export PATH=$PATH:$JAVA_HOME/bin
Then, apply the changes with: source /etc/profile
Step 5: Verify the Installation
Finally, check if everything is working by checking the Java version:
javac -version
📥 Download Free Resources!
I've included the PowerPoint presentation and Java source code for this tutorial in the video description on YouTube. Head over there to grab your copies!
No comments:
Post a Comment