Press first ESC, And then press the keyboard i 1.3.4 Append environment variablesĪdd environment variables to the last few lines of the file as follows: export JAVA_HOME =/Library/java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/HomeĮxport CLASSPATH = $JAVA_HOME/lib/tools.jar: $JAVA_HOME/lib/dt.jar: $JAVA_HOME/jre/lib/rt.jar.įirst press ESC on the keyboard, then enter :wq Use the vi command to open the /etc/profile file vi /etc/profile Enter the command as follows: sudo chmod -777 /etc/profile You need to add write permission to the /etc/profile file. Open Finder -> Preferences (top left corner of the screen)ġ.3 The details of the installation steps are as follows:īy default, /etc/profile has no write permission. If you want to see this directory in the graphical user interface, you need to do two steps 1.2 Modify Finder The real installation path is as follows: /Library/java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home 1.3 The details of the installation steps are as follows:Ġx01 Install Oracle JDK 8 on Mac OSX and configure environment variables 1.1 Download and install Oracle JDK 8.0x01 Install Oracle JDK 8 on Mac OSX and configure environment variables.Install Oracle JDK 8 on Mac OSX and configure environment variables