Eclipse does not recognize org.jdesktop.*

陌路散爱 提交于 2019-11-30 13:55:56

问题


I use JRE system Library [jre7] and when I import org.jdesktop.application.Action I get

The import org.jdesktop cannot be resolved

I removed the build path by Build Path > remove from build path and then I did
project > properties > java build path > add Library > JRE system Library and still same error .


回答1:


The org.jdesktop code is not part of Java SE, so the classes won't be in the JRE. You need to locate and download a JAR file containing the classes, and then add it to your Eclipse buildpath.

(One place to download the JAR is here ... but it is easy to do your own searching if this link breaks. Go to Maven Central or findjar.)




回答2:


If anyone is interested, I had to download 3 JARs:

  • appframework-1.0.3.jar (link in previous post) wich contains org.jdesktop.application classes,
  • swing-layout-1.0.3.jar link wich contains org.jdesktop.layout classes,
  • swing-worker-1.1.jar link wich contains org.jdesktop.swingworker classes, required by the others jar



回答3:


Just download the corresponding jar file from here . And you are good to go. Add the jar to your build path.



来源:https://stackoverflow.com/questions/10882118/eclipse-does-not-recognize-org-jdesktop

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