One installation JDK
Download the dedicated jdk1.7 under Mac:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
After installation, open a terminal input, java-version, confirm the JDK version number jdk1.7
Java- version " 1.7.0_79 " 1.7. 0_79-24.79-b02, Mixed mode)
Two install Eclipse
Download the dedicated Eclipse for EE version under Mac:
http://www.eclipse.org/downloads/
To view the JRE used in eclipse:
1) Open Eclipse, Preferences, java->installed JREs, see the list of JRE on the right, if the jdk1.7 is already installed, the default location is the following address:
/library/java/javavirtualmachines/jdk1. 7. 0_79.jdk/contents/home
Otherwise, click Add, select Standard VM, point to the location of the JDK7 in the path, then you can.
2) then click Java-Compiler, set the compilation level to 1.7, you can enjoy the language features of JDK1.7.
Three configuration Java_home environment variables
1 Understanding the configuration file under Mac
/etc/profile globally shared configuration, which reads this file /etc/BASHRC (typically add system-level environment variables in this file) global (public) configuration, bash When the shell executes, the file is read in any way. ~/.bash_profile (typically add user-level environment variables to this file)
Note: In a Linux system, files with a file name prefix of. File names are hidden files and are viewed using the ls-a command.
2. Configuring the Environment
First open the configuration file, where the global profile/etc/profile is used,
Vi/etc/profile
Write the following into the configuration file,
Java_home=/library/java/javavirtualmachines/jdk1. 7.0_79.jdk/contents/home
paht= $JAVA _home/bin: $PAHT
Export Java_home
Export PATH
and then save. Then restart or use the following command to make the configuration of the environment variable work.
Source/etc/profile
Build a Java development environment under Mac