https://store-images.s-microsoft.com/image/apps.40554.7d907677-fada-4634-a1d9-dc31c7750033.5fe55ba2-cfa3-4164-a44a-5ed51c69d317.03dae073-08b0-4fb4-b0a6-6b1a01fe4bba
Java21 on Ubuntu24.04
HANWEI SOFTWARE TECHNOLOGY(HONG KONG) CO.,LIMITED
Java21 on Ubuntu24.04
HANWEI SOFTWARE TECHNOLOGY(HONG KONG) CO.,LIMITED
Java21 on Ubuntu24.04
HANWEI SOFTWARE TECHNOLOGY(HONG KONG) CO.,LIMITED
Java is a versatile and widely-used programming language designed to build robust, scalable applications across various platforms.
Java 21 on Ubuntu 24.04 offers a powerful combination of the latest Java features and the stability and security of Ubuntu's long-term support. This package is ideal for developers seeking to leverage Java 21's enhanced pattern matching, improved concurrency management, and new APIs while benefiting from Ubuntu's robust performance and reliable updates. It addresses the need for a seamless development environment, reducing the pain of compatibility issues and ensuring that developers can efficiently build, test, and deploy high-quality applications with the latest tools and technologies. This offer primarily benefits software developers, enterprise IT teams, and tech enthusiasts who require a cutting-edge, stable, and secure platform for their development needs.
Please enter the root user first:
sudo su -
Setting the Default Java Version.
Use the following command to open the Java version selection screen:
sudo update-alternatives --config java
A list of available Java versions will be displayed
Select the Java version you want by entering the corresponding serial number (Java versions 8, 11, 17, 21 are pre-installed).
Set the JAVA_HOME environment variable.
When you switch Java versions, make sure that the environment variable JAVA_HOME is also updated according to the version you have selected. This can be set with the following command:
echo “export JAVA_HOME=/usr/lib/jvm/java-(desired version)-openjdk-amd64/” >> ~/.bashrc
source ~/.bashrc
Verify that the setup was successful by echoing the $JAVA_HOME command.
Verify the Java version
After switching the Java version, you can verify the current Java version with the following command.
java -version