Eclipse Mars支持Java9 - 构建路径设置 [英] Eclipse Mars Support for Java9 - Build path settings

查看:123
本文介绍了Eclipse Mars支持Java9 - 构建路径设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装并使用 Eclipse Mars支持Java 9 。但是,当我尝试编译一个简单的Hello World程序时,我在Eclipse中遇到两个错误:

I tried to install and use the Java 9 support for Eclipse Mars. However when trying to compile a simple Hello World program I get two errors in Eclipse:



类型java.lang.Object无法解析。它是从所需的.class文件间接引用的。Main.java / Java9Test / src行
1 Java问题

The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files Main.java /Java9Test/src line 1 Java Problem



  • 项目未构建,因为其构建路径不完整。找不到java.lang.Object的类文件。修复
    构建路径然后尝试构建这个
    项目Java9Test未知Java问题

    The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project Java9Test Unknown Java Problem

    (虽然我看不到
    查看构建路径时的任何错误)

    (although I cannot see any errors when looking at the build path)

    是否有人遇到类似的问题?如何修复?

    Is anyone facing similiar problems? How can this be fixed?

    这是我到目前为止所做的......


    1. 安装OpenJDK 9很好(javac和java正常工作
      )。

    2. Eclipse更新很顺利(我用它做了)市场和使用提供的链接)。

    3. 当使用Java 9启动eclipse时,我遇到两个错误(一个关于Java版本,一个关于垃圾收集器
      选项)但是设法通过删除来修复它们这些选项来自
      eclipse.ini。

    4. 在Eclipse中配置OpenJDK 9,将源级别更改为9并重建项目/重新启动Eclipse几次。

    1. Installing OpenJDK 9 went fine (javac and java are working properly).
    2. Eclipse update went fine (I did it using the Marketplace and using the provided link).
    3. When starting eclipse using Java 9, I got two errors (one regarding the Java version, and one regarding a garbage collector option) but managed to "fix" them by removing these options from eclipse.ini.
    4. Configured the OpenJDK 9 in Eclipse, changed the source level to 9 and rebuilt the project/restarted Eclipse a couple of times.


    推荐答案

    更新:2017年10月16日

    Update:16 October,2017

    来自Eclipse维护者的信息是明确的 ::

    The message is clear from the Eclipse maintainers ::


    Mars 是Eclipse的过去版本。请访问我们的下载页面
    获取最新版本的Eclipse。

    Mars is a past version of Eclipse. Please visit our download page for the latest version of Eclipse.

    您应升级到使用 Eclipse Oxygen.1a(4.7.1a)发布 于2017年10月11日发布,以支持JPMS。

    You shall upgrade to using Eclipse Oxygen.1a (4.7.1a) Release released on October 11, 2017 to support JPMS.

    这篇关于Eclipse Mars支持Java9 - 构建路径设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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