如何在Eclipse 2020-09中开发Java 8项目?

huangapple go评论72阅读模式
英文:

How can i use eclipse 2020-09 to develop java 8 projects?

问题

我是一个常规的IntelliJ用户,但是我的大多数同事使用Eclipse。他们中的很多人都说Eclipse的最新版本"2020-09"需要一个比Java 8更高的JRE才能运行,但不能用于开发需要JRE8的项目。

这对我来说相当令人惊讶,因为我知道在一台机器上安装多个JDK和JRE是可能的,我已经做过很多次。

一个人通常会如何配置已安装的Eclipse 2020-09,以便在需要Java 8 JRE的项目上进行工作呢?

英文:

I am a regular IntelliJ user, but most of my co-workers use Eclipse. A lot of them say the latest version of Eclipse "2020-09", which requires a JRE "higher than Java 8" in order to run, cannot be used to develop projects requiring JRE8.

This is pretty surprising to me, since I know it is possible to install multiple JDKs and JREs on one machine, I've done it plenty of times.

What is the typical way a person would configure Eclipse 2020-09 (already installed) to work on a project that requires a Java 8 JRE?

答案1

得分: 6

JRE 8 apps in eclipse workspace is possible by having the jre 8 jdk. It is true that in order to use eclipse 2020-09 you need java 11+ jdk/jre, but making projects that support jre 8 is still possible.Even I still use 2020-06 and before. Here is a method you could use to get JRE 8 implemented back in your project. Although you can change the defaults, this one will help you change the environment back to java 8 for 1 project.

Right click the library named somthing like "JRE system library[JavaSE-11]". Press properties. This is what you will see JRE System Library chooser image

Choose "Alternate JRE" then click "Installed JREs"Step Image

Press "Add" then you will see 3 options. Choose standard VM. Find your java 8 jdk directory. Usually it is something like C:\Program Files\Java\jdk1.8.0_251.如何在Eclipse 2020-09中开发Java 8项目?

You can configure the default arguments for your jvm runtime. Then simply hit ok,select the jdk-8 library and close it. Then choose alternate jre again and in the drop-down choose jdk-1.8.0 or some name like that. This will only work if you also have java 8 installed alongside java 11 that is configured properly JDK

英文:

JRE 8 apps in eclipse workspace is possible by having the jre 8 jdk. It is true that in order to use eclipse 2020-09 you need java 11+ jdk/jre, but making projects that support jre 8 is still possible.Even I still use 2020-06 and before. Here is a method you could use to get JRE 8 implemented back in your project. Although you can change the defaults, this one will help you change the environment back to java 8 for 1 project.

Right click the library named somthing like "JRE system library[JavaSE-11]". Press properties. This is what you will see JRE System Library chooser image

Choose "Alternate JRE" then click "Installed JREs"Step Image

Press "Add" then you will see 3 options. Choose standard VM. Find your java 8 jdk directory. Usually it is something like C:\Program Files\Java\jdk1.8.0_251.如何在Eclipse 2020-09中开发Java 8项目?

You can configure the default arguments for your jvm runtime. Then simply hit ok,select the jdk-8 library and close it. Then choose alternate jre again and in the drop-down choose jdk-1.8.0 or some name like that. This will only work if you also have java 8 installed alongside java 11 that is configured properly JDK

答案2

得分: 1

你可以使用Java 11启动Eclipse 2020-09,并配置项目以使用Java 8进行编译。但问题是,如果你想使用一个使用CORBA的Eclipse插件,这个模块在Java 11中被移除了。在这种情况下,我建议使用Eclipse 2020-06。

英文:

You can use Java 11 to start the Eclipse 2020-09 and configure a project to compile with Java 8. The problem is if you want a Eclipse plugin that uses CORBA for example. This module was removed from Java 11 earlier. In this case, I recommend to use Eclipse 2020-06.

答案3

得分: 0

2020年9月之前的早期版本使用Java 8是可以工作的。我也有它。然后我升级了,就像你一样,我也遇到了相同的错误信息。

我建议使用旧版本,或者安装JRE 11并将JAVA_HOME环境变量设置为它。

在IDE内部,您可以将Java 8设置为JDK,并在Eclipse在11上运行时使用Java 8开发项目。

英文:

Earlier versions of 2020-09 was working with Java 8. I had it, too. Then I updated and I got the same error message like you.

I propose to use an older one or to install JRE 11 and set the JAVA_HOME env variable to it.

The inside the IDE you can set java 8 like an JDK and develope your project with Java 8 while eclipse is running with 11.

huangapple
  • 本文由 发表于 2020年10月16日 03:16:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/64378329.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定