Install Java 7 on Mac OS X and configure eclipse JDK

Source: Internet
Author: User
  1. Download jdk1.7 for Mac at http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.

  2. Next, double-click DMG to open ,. The installation directory will not be selected until the installation is complete...

  3. Change the JVM preference order, search for [Java Preferences] in Spotlight (the Chinese version should be the Java Preferences), you should be able to see several existing virtual machines, drag Java SE 7 to the top, (For example, I drag a 64-bit version ).

  4. Confirm the version used by Java: open a terminal, enter Java-version, and confirm that the JVM version is jdk1.7.0.

  5. The following operation is how to change the default JRE of eclipse. First, open eclipse (if you change the JVM sequence, set 1.7 to the top, the JVM startup location is not written in the eclipse configuration, so it should have been started with jdk1.7 ).

  6. Open preferences-> JAVA-> installed jres and check the JRE list on the right. If the default jdk1.6 is used, click Add and select MacOS x vm, point to the jdk7 installation location in the path. Note that you must select the home directory.

  7. If you cannot find the installation location of jdk1.7, go to this path to see if there is:/library/Java/javavirtualmachines/jdk1.7.0 _ 10.jdk/ contents/home

  8. If it is correct, the following will identify the location of a bunch of jar packages and give this batch of JRE a handsome name.

  9. to enable the jdk1.7 syntax, you must use the eclipse version 3.8/4.2 or later. (currently, when I wrote this blog, 4.2 has reached milestone4 ), then, you can adjust the compilation level to 1.7 In the workspace/Project attribute to enjoy the language features of JDK 1.7 (however, the premise is that JDK and JRE must be above JDK 1.7 ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.