How do I use JDK 7 on Mac OSX?

前端 未结 15 2177
滥情空心
滥情空心 2020-11-29 17:13

I would like to use the WatchService API as mentioned in this link: http://download.oracle.com/javase/tutorial/essential/io/notification.html

After reading around, I

相关标签:
15条回答
  • 2020-11-29 17:50

    I know that some may want to smack me for re-opening old post, but if you feel so do it I just hope this may help someone else trying to set JDK 7 on Mac OS (using IntelliJ).

    What I did to get this working on my machine is to:

    • followed instructions on Oracle JDK7 Mac OS X Port for general installation
    • in IntelliJ open/create new project so you can add new SDK (File > Project Structure)
    • select Platform Settings > SDKs, press "+" (plus) sign to add new SDK
    • select JSDK and navigate to /Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home. Do not get it mistaken with /Users/YOUR_USERNAME/Library/Java/. This will link 4 JARs from "lib" directory (dt.jar, jconsole.jar, sa-jdi.jar and tools.jar)
    • you will need also add JARs from /Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home/jre/lib (charsets.jar, jce.jar, JObjC.jar, jsse.jar, management-agent.jar, resources.jar and rt.jar)
    0 讨论(0)
  • 2020-11-29 17:51

    As of April 27th there is an offical Oracle release of Java SE 7u4. Download the disk image and run the installer - then see the Mac readme.

    0 讨论(0)
  • 2020-11-29 17:51

    What worked for me on Lion was installing the JDK7_u17 from Oracle, then editing ~/.bash_profile to include: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home

    0 讨论(0)
提交回复
热议问题