Saturday, 17 April 2021

Install JDK and set up Java home path for macOS and Windows?





WHERE to DOWNLOAD JDK:

https://www.oracle.com/java/technologies/javase-jdk16-downloads.html


Install JDK

Installing the JDK on macOS

To install the JDK on macOS:

1. Download the JDK .dmg file, jdk-15.interim.update.patch_osx-x64_bin.dmg from Java SE Downloads page.

Click Accept License Agreement.

2. From either the browser Downloads window or from the file browser, double-click the .dmg file to start it.

A Finder window appears that contains an icon of an open box and the name of the .pkg file.

3. Double-click the JDK 15.pkg icon to start the installation application.

The installation application displays the Introduction window.

4. Click Continue.

The Installation Type window appears.

5. Click Install.

A window appears that displays the message: Installer is trying to install new software. Enter your password to allow this.

6. Enter the Administrator user name and password and click Install Software.

The software is installed and a confirmation window is displayed.

After the software is installed, you can delete the .dmg file if you want to save disk space.

Add java home path in MacOs

Open ~/.bash_profile in any text editor and add:

export JAVA_HOME=$(/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home)

Save and close the file.

Open a Terminal and run the source command to apply the changes:

source ~/.bash_profile

Now we can check the value of the JAVA_HOME variable:

echo $JAVA_HOME


Install jdk in Windows:
https://docs.oracle.com/javase/10/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-371F38CC-248F-49EC-BB9C-C37FC89E52A0

Set Java home in windows-10:

Windows 10 and 8

1. Open Search and type advanced system settings

2. In the shown options, select the View advanced system settings link

3. Under the Advanced tab, click Environment Variables

4. In the System variables section, click New (or User variables for single user setting)

5. Set JAVA_HOME as the Variable name and the path to the JDK installation as the Variable value and click OK

6. Click OK and click Apply to apply the changes 







No comments:

Post a Comment

All Time Popular Posts

Most Featured Post

Introduction to Web Testing with Playwright

  Introduction to Web Testing with Playwright 📌  Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 📌  YouTube channel:  https://lnkd.in/gGUG...