How to install JDK 8 on OS X Mountain Lion with the new lambda features
java-8, macos
Solution
If you just want to try coding with JDK8, you dont need to install it on your system. Just as a JRE in a version of eclipse with Java 8 support. To get a beta build of eclipse you can either build it yourself (I had issues with this) or download a pre-built version. I couldn't find any pre-built versions on the eclipse site, but I found one here. http://downloads.efxclipse.org/eclipse-java8/
Once You have that downloaded, go to Eclipse > Preferences > Java > Installed JREs Click Add, and specify the java 8 home directory. For me this was `/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home.`
Now create a project. The source level of 1.8 is not available in the UI, you need to modify the `<my_project>/.settings/org.eclipse.jdt.core.prefs` and make sure you have the lines below.
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.source=1.8
Then you're good to go.
The build of eclipse is beta, so code assist doesn't always work with the new syntax. But it compiles and runs java 8 code fine :-)
Problem
Can anybody help me with installing JDK 8 on mac Mountain? I have installed `java_for_os_x_2013002_dp__11m4203.dmg` and I can see: `/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home` . But don't know what more to do. How can I make a symlink to the new version and so on? I use Eclipse and maven so I don't want any conflict with them. I'm a new mac user. JDK 7 is already installed on my mac but I just want do some experiment with the new lambda expression. Thanks for all help