Oracle JDK 21 installation on RHEL 9 | How to install Java 21 on Linux with JAVA_HOME

Published: 28 March 2024
on channel: java frm
30
0

In this video we are going to see how to install Oracle JDK 21 on Red hat Enterprise Linux 9 for all users with JAVA_HOME Environment Variable

In this Example:

src ---- contains two java modules IPv4Validator and IPv4ValidatorClient Modules. Each Module must contain module-info.java which is mandatory.
classes ---- will store all the compiled class files of Java Modules.

Here IPv4Validator Module contains module-info.java which exports the com.javafrm package, so that other modules can access the package and com.javafrm package contains IPv4Validator.java .
Class name and Method should be public, then only you can access this class and required methods from other modules.

Next IPv4ValidatorClient Module contains contains module-info.java which requires (calls) IPv4Validator Module.
It contains org.javafrm package which contains IPv4ValidatorClient.java (Main class) and access the class and methods from IPv4Validator Module.

Example commands:

javac --module IP4ValidatorModule -d /opt/Java-Module-Programs/Modules/classes --module-source-path /opt/Java-Module-Programs/Modules/src

javac --module IP4ValidatorClientModule -d /opt/Java-Module-Programs/Modules/classes --module-source-path /opt/Java-Module-Programs/Modules/src

java --module-path /opt/Java-Module-Programs/Modules/classes --module IP4ValidatorClientModule/org.javafrm.IPv4ValidatorClient

#oraclejdk #java #jdkinstallation #installjdk #installjava #javajdk #javalinux #javahome #rhel9 #jdk21


Watch video Oracle JDK 21 installation on RHEL 9 | How to install Java 21 on Linux with JAVA_HOME online without registration, duration hours minute second in high quality. This video was added by user java frm 28 March 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3 once and liked it people.