Download the DMG file of JDK-7 from here; Click on DMG and follow the instructions. It will install and configure JDK-7 on mac. Now in your android studio go to File-Project Structure - SDK Location. In JDK location click on browse and go to /-Library-Java-JavaVirtualMachines-jdk1.7.060.jdk-Contents-Home. Java SE 7 Archive Downloads. Installing JDK on Mac OS X. Looking for Linux? Here is the link to the guide. To check if homebrew is installed run the following command, and it should produce the following output: $ brew -version Homebrew 1.3.2 Homebrew/homebrew-core (git revision 44a0; last commit 2017-09-19). Now you should be set to use JDK on Mac OS X.

How do I use JDK 7 on Mac OSX?

  • okysabeni
  • 2011-06-07 15:12
  • 7

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

Download Jdk 7 On Mac Homebrew

After reading around, I found out that WatchService is part of the NIO class which is scheduled for JDK 7. So, it is in beta form. It's fine.

http://jdk7.java.net/download.html has the JDK which I downloaded and extracted. I got a bunch of folders. I don't know what to do with them.

Download Jdk 7 On Mac Homebrew Download

Then, I read around some more and found that some nice group of people created JDK 7 as a binary so someone like me can install it easily. It is called Open JDK:http://code.google.com/p/openjdk-osx-build/

Mac brew install jdk

So, I downloaded the .dmg file and install it. Then I open 'Java Preference' and see that OpenJDK7 is available.

So, now I feel that I can start trying out WatchService API. From the tutorial in the first link, the author gave a .java file to test it out first and make sure that it is running. Here is the link to the file:http://download.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java

So, I boot up Eclipse (actually I use STS) and create a new Java project and choose JaveSE-1.7 in the 'use an execution environment JRE:'. Under the src folder, I copy pasted the WatchDir.java file.

And I still see tons of squiggly red lines. All the 'import.java.nio.*' are all red and I cannot run it as a Java app.

Mac Jdk Download

What do I need to do?