[英]Java swing on eclipse oxygen 4.7.3a?
I am trying to use windowbuilder on eclipse oxygen 4.7.3a on macOS highSierra. 我试图在macOS highSierra上的eclipse oxygen 4.7.3a上使用windowbuilder。 it installed fine but every time I try to open the design part it displays this error
它安装正常,但是每次我尝试打开设计部件时,都会显示此错误
Eclipse is running under 0, but this Java project has a 1.8 Java compliance level, so WindowBuilder will not be able to load classes from this project.
Eclipse在0以下运行,但是此Java项目的Java遵从级别为1.8,因此WindowBuilder将无法从该项目中加载类。 Use a lower level of Java for the project, or run Eclipse using a newer Java version.
对项目使用较低级别的Java,或者使用较新的Java版本运行Eclipse。
I tried everything. 我尝试了一切。 like changing the running enviroment, .jre files, try different JDE.
如更改运行环境,.jre文件,请尝试使用其他JDE。 nothing working.
没有任何作用。 any suggestions?
有什么建议么?
Your only short term solution is to use a Java version <= 9. 您唯一的短期解决方案是使用<= 9的Java版本。
Initially WindowBuilder did not work with Java 9 for several reasons. 最初,由于多种原因,WindowBuilder无法与Java 9一起使用。 See Bug 526098 - WindowBuilder fails to work on Java 9 .
请参见错误526098-WindowBuilder无法在Java 9上运行 。
One of those issues was that the the System Property java.version was unexpectedly just "9": 这些问题之一是系统属性java.version意外地只是“ 9”:
Please check that you have exactly 9.0 JDK, it worked for me with 9.0.1 until I downgraded target JRE to 9.0, which has unusual
System.getProperty("java.version").equals("9")
请检查您是否确实拥有9.0 JDK,它对9.0.1一直有效,直到我将目标JRE降级到9.0,该目标具有不寻常的
System.getProperty("java.version").equals("9")
The fixes to get WindowsBuilder working on Java 9 were only completed on 2/21/18, and based on your error it looks like a similar issue exists when running WindowsBuilder using Java 10. I suggest you create a Bug Report with Eclipse . 使WindowsBuilder在Java 9上运行的修复仅在2/21/18上完成,并且基于您的错误,当使用Java 10运行WindowsBuilder时,似乎存在类似的问题。建议您使用Eclipse创建错误报告 。
See also: 也可以看看:
How to uninstall current version?(Mac) 如何卸载当前版本?(Mac)
Go to /Library/Java/JavaVirtualMachines/ to see current version of java and replace jdk1.8.0_131.jdk with yours. 转到/ Library / Java / JavaVirtualMachines /查看Java的当前版本,并将jdk1.8.0_131.jdk替换为您的Java版本。
Install Java 8 : 安装Java 8 :
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Then: Right click on your project and go to Properties 然后:右键单击您的项目,然后转到“属性”
Make sure your configuration look like this, At the top of picture Configure Workspace settings click on it (Uncheck project specification settings) and then see image below 确保您的配置如下所示:在“配置工作区”设置图片的顶部,单击它(取消选中项目规范设置),然后查看下图
Apply same as in picture Then enable "project specification settings" 与图片相同,然后启用“项目规格设置”
Restart Your Eclipse 重新启动Eclipse
Done!! 做完了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.