Step 1: Download the Installer from the following link https://www.oracle.com/java/technologies/downloads/#java17
Choose the installed based on operating system. If you are Intel choose “x64 DMG Installer” and if you are on M1 chip then choose “ARM64 DMG Installer”
Step 2:
Double click the downloaded .dmg file and it will open the .pkg file. Double click the .pkg file -> Continue -> Install -> Provide your password -> Install Software -> Close. It is safe to move the JDK Installed to the Trash.
You are all set.