title: How do I use JDK 7 on Mac OSX?
body: <p>I would like to use the WatchService API as mentioned in this link:
  <a href="http://download.oracle.com/javase/tutorial/essential/io/notification.html" rel="nofollow noreferrer">http://download.oracle.com/javase/tutorial/essential/io/notification.html</a></p>
  
  <p>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.</p>
  
  <p><a href="http://jdk7.java.net/download.html" rel="nofollow noreferrer">http://jdk7.java.net/download.html</a> has the JDK which I downloaded and extracted. I got a bunch of folders. I don't know what to do with them.</p>
  
  <p>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:
  <a href="http://code.google.com/p/openjdk-osx-build/" rel="nofollow noreferrer">http://code.google.com/p/openjdk-osx-build/</a></p>
  
  <p>So, I downloaded the .dmg file and install it. Then I open "Java Preference" and see that OpenJDK7 is available.</p>
  
  <p>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:
  <a href="http://download.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java" rel="nofollow noreferrer">http://download.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java</a></p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>What do I need to do?</p>