How to install java on Mac notebook

submited by
Style Pass
2021-05-30 03:12:43

(2) Configure the PATH and CLASS_PATH paths, open the profile file in the terminal terminal (requires sudo super authority, and enter the password), and execute the command as follows:

Just enter the password as prompted. Normally, the vim editor will open a file. Under English input, press "i" to enter the editing mode, and add the following content at the end of the file:

Note: If the installation package you downloaded is not of this version, you need to replace it with your own jdk installation package name, jdk-9.0.1.jdk is a folder, according to the JDK version you installed, the specific way to check: open Finder ( Finder), shortcut key "Command + Shift + G", enter: /Library/Java/JavaVirtualMachines/, click enter, you can see it.

(3) After adding the above content, press the "esc" key to exit the insert mode, in the English input state, enter ":wq" to save and exit the profile, and then execute the following command to make the modified content take effect immediately without restarting, command as follows:

Note: If the following message prompting error failure appears, you can enter ":wq!" to force save and exit the profile. The reason is that this system file is "read-only" by default for security, and we need to change its permissions to modify its content. ":Wq!" is used here to avoid repeated modifications.

Leave a Comment