Java swing on eclipse oxygen 4.7.3a?

与世无争的帅哥 提交于 2019-11-29 18:17:20

Your only short term solution is to use a Java version <= 9.

Initially WindowBuilder did not work with Java 9 for several reasons. See Bug 526098 - WindowBuilder fails to work on Java 9.

One of those issues was that the the System Property java.version was unexpectedly just "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")

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.

See also:

Uninstall Java Version and Install lower version of Java(8).Support for WindowBuilder is not provided anymore.

How to uninstall current version?(Mac)

Go to /Library/Java/JavaVirtualMachines/ to see current version of java and replace jdk1.8.0_131.jdk with yours.

  1. sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk
  2. sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
  3. sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
  4. sudo rm -rf ~/Library/Application\ Support/Oracle/Java

Install Java 8:

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

Done!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!