Eclipse + Java 8 support?
Asked Answered
G

7

43

How can I get Java 8 to work with Eclipse?

I have followed this guide but doesn't work. I've also seen the Eclipse Java 8 wiki page, but they don't explain what to do with the checked out git repositories.

Gerhard answered 22/2, 2013 at 15:15 Comment(2)
The current state of Java 8 support in JDT - dev.eclipse.org/mhonarc/lists/jdt-core-dev/msg02263.htmlFranz
this works: oracle.com/technetwork/articles/java/lambda-1984522.htmlKer
D
23

For Kepler SR2 (4.3.2) a feature patch needs to be installed in order to get JAVA 8 support. Follow these steps:

  • Eclipse - Help (MENU) > Install New Software...

  • enter the following URL into the 'Work with' field:
    http://download.eclipse.org/eclipse/updates/4.3-P-builds/

  • press 'Enter'

  • select category 'Eclipse Java 8 Support (for Kepler SR2)'
  • click 'Next'
  • click 'Next'
  • accept the license
  • click 'Finish'

  • restart Eclipse when asked

source: link

@Elisabeth

In order to have the desired JRE/ JDK on BuildPath, follow these steps.

  • Right click on Project from Package Explorer
  • Select BuildPath and then select Configure Builpath
  • Select Libraries Tab from the popped up Properties window
  • Select the current JRE System Library
  • Click Remove button
  • Click on Add Library button
  • Select JRE System Library
  • There you will be able to add your desired JRE/ JDK version using 3 different methods.

If you don't find your desired version of JRE/ JDK there in those 3 options, then you will have to install that first. The following link helps you in detail with screen shots to do the same. Hope it helps.

source: link

Doubleton answered 6/4, 2014 at 20:28 Comment(1)
Just read the page at your link too, also very helpful, thank you for writing that up!Maidenhead
D
7

As written in https://wiki.eclipse.org/JDT_Core/Java8 :

"Starting with I20140318-0830 all our Luna (4.4) builds contain the Eclipse support for Java™ 8. For Kepler SR2 (4.3.2) a feature patch is available. "

enter image description here

So right now you need to download a non stable eclipse release.

Go to : http://download.eclipse.org/eclipse/downloads/

There download a release older than or equals to I20140318-0830

enter image description here

Then you choose your version according to your OS :

enter image description here

click on the (http) link, the download will start :

enter image description here

Note that according to eclipse website : Java™ 8 has not yet landed in our standard download packages. But you can add it to your existing Eclipse Kepler SR2 package. It will be included in the Luna packages starting with M7 on May 9/2014.

so after May 9/2014 getting eclipse working with java 8 will be simpler.

Discophile answered 28/4, 2014 at 14:21 Comment(0)
D
5

Now that Java 8 has shipped, Eclipse has released support for it. Java 8 is available as an 'update' for Eclipse Kepler (Eclipse 2013 release) and is available in integration / nightly builds towards Eclipse Luna (Eclipse 2014 release). For more information about enhancements and how to install it in your current version of the IDE, see http://eclipsesource.com/blogs/2014/03/25/eclipse-support-for-java-8/

Decry answered 25/3, 2014 at 19:16 Comment(0)
N
4

It appears that this is still very much a work in progress (hence, there will be stability issues). Is there a particular reason you want to use Java 8?

This explains what you should be doing:

  • Checkout the BETA_JAVA8 branch of the following git repositories: JDT/Core repository - git://git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git
  • You need to install a JDK8 build as an installed JRE in order to run the tests using the JavaSE-1.8 Execution Environment.
  • For more information on how to work with git repositories, look at http://wiki.eclipse.org/Platform-releng/Git_Workflows .
  • As API Baseline, use 3.8 (or 3.8 RC4 until 3.8 is released).

I have not downloaded this repo, but I would assume it contains the eclipse jdt core (as the name states). I would just wait until a stable release is finished.

Nonego answered 22/2, 2013 at 15:42 Comment(1)
Thanks, but on the first step, it doesn't say what to do with the checked out stuff. You know?Gerhard
S
3

As already stated here:

The Kepler release does not include Java 8 support, as Java 8 still isn't released yet. Try again with the next Eclipse release or use Eclipse beta releases like the one by e(fx)clipse. Have a look at this bug report from time to time for progress on Java 8 in Eclipse's JDT.

EDIT: Starting with I20140318-0830 all Luna (4.4) builds contain support for Java 8. The final version of Eclipse Luna (4.4) will be released at the end of June 2014. For Kepler SR2 (4.3.2) a feature patch needs to be installed.

Snappish answered 12/7, 2013 at 17:17 Comment(0)
S
2

Link to the Eclipse Java 8 support Update site https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler

Shanklin answered 4/4, 2014 at 11:43 Comment(2)
I installed the patch for Kepler, however, when I switch the compiler compliance level in the project settings, it asks me to change the build path, but doesn't give java 1.8 as an option in the "installed JREs" section. Any ideas on how to actually use this patch?Maidenhead
URLs should be included in an answer for further reading only. This answer appears to rely heavily on the content of a URL and would benefit from a summary of the URL being included in the answer.Stanza
A
0

For Eclipse Mars.1 Release (4.5.1) you have to download extra package with jre-8u73-windows-x64.tar.gz to your java8/jre folder and point it in -VM section in eclipse.ini. It works for me.

Ardennes answered 18/2, 2016 at 10:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.