简体   繁体   中英

Incompatible Java Versions for WindowBuilder

I Installed WindowBuilder on Eclipse to create a Graphic User Interface for a program. When I go to the 'Design' tab the following error appears:

Eclipse is running under 1.8, but this Java project has a 10 Java compliance level, so WindowBuilder will not be able to load classes from this project. Use a lower level of Java for the project, or run Eclipse using a newer Java version.

I currently have Installed Java 8 (Update 171), and Oxygen.3a (4.7.3a) (Eclipse Version). I had previously downloaded Java 10, but I read that there's a bug where WindowBuilder doesn't work on that version, and that it is recommened the Version 8, which is the one I downloaded and installed (after uninstalling Version 10). But the problem's still there.

What could I do to solve this? Thank you.

Just change the compliance level of the project from 10 to 1.8, rebuild and the Design tab should work:

  1. To change the project's compliance level:

    • Select the project's node in Project Explorer , right-click and select Properties .
    • Select Java Compiler from the column on the left.
    • Uncheck Use Compliance from execution environment...
    • Select 1.8 from the drop list for Compiler compliance level . (Presumably its current value is 10.)
    • Click the Apply and Close button.
  2. Rebuild the project using 1.8 compliance.
  3. The Design tab should work fine now.

合规等级

As a separate issue, since you have uninstalled Java 10 you should also remove it from your Installed JREs if you haven't done that already:

  • Windows > Preferences > Java > Installed JREs
  • Select the entry for JDK 10 and click the Remove button.
  • If the JDK 10 entry was checked when you removed it you will be forced to check another JRE definition.
  • Click the Apply and Close button.

只需将项目的合规性级别从当前更改为 1.8,重建和设计选项卡应该可以工作:它对我有用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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