Tuesday, April 1, 2014

Setup your Java 8 Eclipse Project

If the time had come and you can easily download and install Eclipse with Java 8 support, great... if not, try this out: Setup Eclipse with Java 8 and Lambda expressions

Setup a Java 8 project:
  • Create a Java project
  • Make sure you have a Java 8 JDK installed in Eclipse goto: window > preferences > Java > Installed JREs, and if not add it!
  • If you would like your entire workspace to be configured to work with Java 8 perform the flowing action in window > preferences. Otherwise perform these on the project properties.
  • You would have to make sure that your compiler compliance level match 1.8:
    **> Java Compiler, and make sure the compliance level is set to 1.8.
  • Make sure the Java library used in the project is the Java 8 JDK at: **> Java Build Path
  • Go to this link and this link, copy the classes as string(Yeah simply mark it all and copy it)

    And now...
  • Click on a package in your project and paste the text(Yeah simply paste the "text" onto the package in the Package Explorer!)
  • Poof... you have a two classes in that package(I just love Eclipse don't you!?).
  • It should compile and be executable.

Let me know if you had issues, so I can make this better!

Setup Eclipse with Java 8 and Lambda expressions

I thought this would be a walk in the park... but this was annoying as F***, I've spent a half a day searching Google only to find a pile of rubbish that lead to dead links and wrong instructions to download versions of Eclipse that don't do the trick or take over 3 hours to download(DEAR GOD 3 HOURS), and a bunch instruction about a pre-release Eclipse versions which does not work!

So... what does work:


Took exactly a couple of minutes to get it all set up...