How to install Eclipse Temurin OpenJDK 22 in Windows 11 with JAVA_HOME Environment Variable

Опубликовано: 14 Январь 2025
на канале: java frm
203
0

In this video we are going to see How to install Eclipse Temurin OpenJDK 22 in Windows 11 with JAVA_HOME Environment Variable and How to Compile and Run Java Module Program.

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

Here PalindromeModule Module contains module-info.java which exports the com.javafrm package, so that other modules can access the package and com.javafrm package contains Palindrome.java and has one method.
Class name and Method should be public, then only you can access this class from other modules.
Next PalindromeClient Module contains contains module-info.java which requires (calls) Palindrome Module.
It contains org.javafrm package which contains PalindromeClient.java (Main class) and access the class and methods from Palindrome Module.

Example Java Commands:

javac --module PalindromeModule -d D:\Java-Module-Programs\Modules\classes --module-source-path D:\Java-Module-Programs\Modules\src

javac --module PalindromeClientModule -d D:\Java-Module-Programs\Modules\classes --module-source-path D:\Java-Module-Programs\Modules\src

java --module-path D:\Java-Module-Programs\Modules\classes --module PalindromeClientModule/org.javafrm.PalindromeClient

#adoptiumjdk #java #jdkinstallation #installjdk #installjava #javainstallation #javajdk #javahome #windows11 #jdk22