Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » What version of Java for compiler?(What JDK version should I be using?)
What version of Java for compiler? [message #1837487] Sun, 31 January 2021 22:24 Go to next message
Martin Hebel is currently offline Martin HebelFriend
Messages: 2
Registered: January 2021
Junior Member
Hi, I just have a question on version of Java, which compiler, etc. I'm working on software for general distribution & sale.

Last time I tried Eclipse 2020-12, it installed and used OpenJDK 11 I believe. I had some graphics issues to reverted back to Eclipse 2020-3 using JDK 1.8.

I know that version is WAY old. So, I installed 2020-12 again thinking it would give me OpenJDK-11 again while I tried to resolve graphics issues. But it didn't do that - it was still using JDK 1.8. (because my project was set up for it? - But I thought 2020-12 needed 11 at least??)

So, I downloaded openJDK 15 and set it up as the compiler.

Should I stick to 1.8 compatibility?

When I tried others, like 15 or 11, my code had about a billion errors, it was finding multiple instances of the library.... dunno why???

In any case, should I stick with compiling with 15 with 1.8 compatibility??

Thanks for any answers you can give!
-MH

Re: What version of Java for compiler? [message #1837495 is a reply to message #1837487] Mon, 01 February 2021 06:08 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Eclipse can use one version of Java to run Eclipse, and any other version of Java to compile project code with. The most recent versions of Eclipse require at least Java 11 to run Eclipse with, but you can still use Java 8, or whatever, to compile projects with. Just install whatever versions of Java you want, using one to run Eclipse with, and the other(s) to compile your projects with.
Re: What version of Java for compiler? [message #1837971 is a reply to message #1837495] Thu, 11 February 2021 13:25 Go to previous messageGo to next message
Mark Smith is currently offline Mark SmithFriend
Messages: 82
Registered: September 2020
Member
The default Java compiler version used by Maven is Java 1.5 . Why that is still the default Java compiler version is a good question, since Java 5 was released in 2004.
Re: What version of Java for compiler? [message #1838823 is a reply to message #1837971] Fri, 05 March 2021 17:58 Go to previous messageGo to next message
Ben Gorheam is currently offline Ben GorheamFriend
Messages: 2
Registered: March 2021
Junior Member
Hey there,
So any suggestions on the version to use? I've got the newer one and faced the same issue as Martin. Can there be the one version for both - Eclipse and code itself?
Re: What version of Java for compiler? [message #1838833 is a reply to message #1838823] Fri, 05 March 2021 21:51 Go to previous message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
You can certainly use the same JDK version running both Eclipse and your code, if that satisfies the requirements of your project. It's quite common for projects to be limited to Java 8. In that case, you will definitely need two JDK versions, because Eclipse as of recent versions requires at least Java 11. If you have no limitations, then you might as well use the latest JDK version (15, as of today).
Previous Topic:Starting up badly in Windows 10
Next Topic:Java 16 Support for Eclipse 2021-03
Goto Forum:
  


Current Time: Tue Apr 23 14:23:12 GMT 2024

Powered by FUDForum. Page generated in 0.04402 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top