简体   繁体   English

Eclipse看不到Java

[英]Eclipse can't see Java

So I'm throughly confused. 所以我很困惑。 Eclipse both does and doesn't see Java. Eclipse可以看到Java,也没有看到Java。 I'm running Eclipse Photon (4.8.0), Java 10.0.2, and macOS High Sierra 10.13.6. 我正在运行Eclipse Photon(4.8.0),Java 10.0.2和macOS High Sierra 10.13.6。 In the Eclipse preferences, under the Oomph menu, it does show the accurate location of the JDK, but there is no Java menu in the preferences, and it does not recognize any of my project files and does not compile. 在Oomph菜单下的Eclipse首选项中,它确实显示了JDK的准确位置,但是首选项中没有Java菜单,并且它无法识别我的任何项目文件,也无法编译。

Edit: Screenshots showing a project properties pane and the settings panel when searching for Java and a link to the Eclipse About config: 编辑:屏幕快照显示搜索Java时的项目属性窗格和设置面板以及Eclipse About配置的链接:

Eclipse About Config Eclipse关于配置

项目属性窗格

首选项中的搜索结果

OK, with the config information, it looks like you downloaded Eclipse IDE for Testers (note the eclipse.product property). OK,有了配置信息,看起来就像您下载了Eclipse IDE for Testers(注意eclipse.product属性)。 I don't know the exact purpose of that package but though it does have at least parts of the JDT features, it is clearly missing a lot of stuff for Java development. 我不知道该软件包的确切用途,但是尽管它确实具有JDT功能的至少一部分,但是它显然缺少许多Java开发方面的东西。

The Java VM seen by Oomph is simply what it's been able to discern is available on your system and highlights which is being used to run eclipse (it isn't showing eclipse defined JREs). Oomph看到的Java VM就是可以识别的Java VM,它可以在您的系统上使用,并突出显示了用于运行eclipse的Java VM(它没有显示eclipse定义的JRE)。

So, you'll need to download Eclipse IDE for Java Developers or one of several other packages that include Java development tools (like Eclipse IDE for Java EE Developers, among others). 因此,您需要下载用于Java开发人员的Eclipse IDE或其他包含Java开发工具的软件包(例如,用于Java EE开发人员的Eclipse IDE)之一。 https://www.eclipse.org/downloads/packages/ https://www.eclipse.org/downloads/packages/

Without a screenshot, I can't be sure but it looks like your project is just a plain project. 没有截图,我不能确定,但​​是看起来您的项目只是一个简单的项目。 Right click on it then go to Configure>Convert to Faceted Form at which point the project facets page will show up and you can click the Java facet, then click "Apply and Close". 右键单击它,然后转到Configure> Convert to Faceted Form,此时将显示项目方面页面,您可以单击Java facet,然后单击“应用并关闭”。

The project should now be a Java project and you can set build path and so on. 该项目现在应该是一个Java项目,您可以设置构建路径等。 If not, then more info about the project would help, perhaps a screenshot of Project Properties page (right click on the project and select Properties). 如果没有,那么有关该项目的更多信息可能会有所帮助,也许是“项目属性”页面的屏幕截图(右键单击该项目,然后选择“属性”)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM