This article describes how to build our Java EE work environment under Mac, which is quite easy for beginners to understand.
I. Installation and configuration of JDK 1, first we go to the Oracle website JDK
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Next, double-click to install the DMG
A series of next click on the line
3. You can find the JDK installation path in the Finder.
Open Finder to find Macintosh HD This is our hard drive
Some students may not find the Macintosh HD
Open Finder Preferences settings Sidebar tick the button on the hard drive so that the MACINTOSHHD appears in the Finder's sidebar.
The path is: Macintosh hd--Resource Library--java--javavirtualmachines--jdk1.***
As shown, we found the installation path of our JDK here I installed the version 7 and 8, because it involves a number of projects need so loaded two.
Here are some of the JDK's directory structures:
4, the JDK configuration environment
Next is the JDK's environment configuration
Turn on your Mac's terminal
Input
Touch. Bash_profile
VI. bash_profile
Configuration
java_home=/library/java/javavirtualmachines/jdk1.8.0_101.jdk/contents/home
Path= $JAVA _home/bin: $M 2_home/bin: $PATH:.
Classpath= $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar:.
Export Java_home
Export PATH
Export CLASSPATH
Color-coded places need to be replaced with the JDK version you installed other basic unchanged
Enter after input: Enter command mode input Wq save Exit VI Editor
then enter the source. Bash_profile Update configuration on the terminal
Test whether the installation configuration was successful
Input Java-version
A successful version number is configured successfully.
Installation configuration of Java EE environment < one > JDK in Mac OS system