How do I use JDK 7 on Mac OSX?

前端 未结 15 2247
滥情空心
滥情空心 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:36

    It's possible that you still need to add the JDK into Eclipse (STS). Just because the JDK is on the system doesn't mean Eclipse knows where to find it.

    Go to Preferences > Java > Installed JREs

    If there is not an entry for the 1.7 JDK, add it. You'll have to point Eclipse to where you installed your 1.7 JDK.

    If Eclipse can't find a JRE that is 1.7 compatible, I'm guessing that it just uses your default JRE, and that's probably still pointing at Java 1.6, which would be causing your red squiggly lines.

提交回复
热议问题