如何在Eclipse Oxygen中设置java 10? [英] How to set up java 10 in Eclipse Oxygen?

查看:390
本文介绍了如何在Eclipse Oxygen中设置java 10?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定最新版的eclipse即Oxygen是否支持java 10。我从我的mac机器上的首选项配置了Java 10的JRE。

I am not sure if latest version of eclipse i.e. Oxygen supports java 10 or not. I configured the JRE for java 10 from preferences on my mac machine.

另外,我尝试添加maven编译器插件在我的pom.xml下面: -

Also, I tried adding maven compiler plugin as below to my pom.xml:-

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>10</source>
                <target>10</target>
                <compilerVersion>10</compilerVersion>
                <fork>true</fork>
                <executable>/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home</executable>
            </configuration>
        </plugin>

我在设置运行配置后也尝试过: -

I also tried after setting the Run Configurations as below:-

任何人都知道如何让它适用于java-10。

Anybody knows how could I make it work for java-10.

我尝试运行以下代码: -

I tried running code below:-

public class App {
    public static void main(String[] args) {
        var list = new ArrayList<String>();
        System.out.println("Hello World!");

    }
}

更新: - 我在评论中应用了建议的补丁,但仍然失败。

Update:- I applied the suggested patch in comment and it still fails.

以下屏幕截图: -

Screenshot below:-

< a href =https://i.stack.imgur.com/jt95N.png =noreferrer>

此外,我按照这个帖子使其编译。因此,编译实际上是从eclipse( maven install )开始的,但是当我尝试运行应用程序时它仍然失败。

Also, I followed this post to make it compile. So, compilation actually worked from eclipse (maven install) but it still fails when I try to run the application.

推荐答案

所以,我请求eclipse查看它,看看补丁为什么不起作用。

So, I requested eclipse to look into it and see why the patch don't work.

这里是我得到的答案

下面是Eclipse社区的确切评论: -

Below is the exact comment from Eclipse community:-


注意:此功能补丁已禁用。原本打算在4.7.3版本之上安装
。现在,Java 10支持可通过4.7.3a版本在
下载页面上获得。支持此功能的最早版本是
,可以从
下载

Note: This feature patch is disabled. It was originally intended to be installed on top of 4.7.3 builds. Now, the Java 10 support is available on the downloads page via the 4.7.3a builds. The earliest build that is supporting this feature can be downloaded from

所以从这里。使用java 10 此处查看Eclipse的新功能。

So download the supporting build from here. And see the new features of Eclipse with java 10 here.

希望它有所帮助!

编辑:补丁支持是暂时的,已被删除。所以,现在你需要安装最新的eclipse版本,并且它支持java 10

The patch support was temporary and has been removed. So, now you need to install the latest eclipse version and it's having the support for java 10

这篇关于如何在Eclipse Oxygen中设置java 10?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆