Netbeans 可视化库和 java.lang.NoClassDefFoundError [英] Netbeans Visual Library and java.lang.NoClassDefFoundError

查看:57
本文介绍了Netbeans 可视化库和 java.lang.NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习本教程 尝试并开始了解 Visual Library.我一步一步地跟着它,检查了一切......每次我尝试运行它时,我都会得到这个:

I'm trying to follow this tutorial to try and begin to understand the Visual Library. I followed it step by step, checked everything... and everytime I try to run the thing, I get this :

线程main"中的异常java.lang.NoClassDefFoundError:org/openide/util/LookupListener在 vislibdemo.GraphSceneImpl.attachNodeWidget(GraphSceneImpl.java:49)在 vislibdemo.GraphSceneImpl.attachNodeWidget(GraphSceneImpl.java:19)在 org.netbeans.api.visual.graph.GraphScene.addNode(GraphScene.java:100)在 vislibdemo.GraphSceneImpl.(GraphSceneImpl.java:34)在 vislibdemo.Main.initComponents(Main.java:39)在 vislibdemo.Main.(Main.java:28)在 vislibdemo.Main.main(Main.java:22)引起的:java.lang.ClassNotFoundException:org.openide.util.LookupListener在 java.net.URLClassLoader$1.run(URLClassLoader.java:202)在 java.security.AccessController.doPrivileged(Native方法)在 java.net.URLClassLoader.findClass(URLClassLoader.java:190)在 java.lang.ClassLoader.loadClass(ClassLoader.java:307)在 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)在 java.lang.ClassLoader.loadClass(ClassLoader.java:248)... 7个

Exception in thread "main" java.lang.NoClassDefFoundError: org/openide/util/LookupListener at vislibdemo.GraphSceneImpl.attachNodeWidget(GraphSceneImpl.java:49) at vislibdemo.GraphSceneImpl.attachNodeWidget(GraphSceneImpl.java:19) at org.netbeans.api.visual.graph.GraphScene.addNode(GraphScene.java:100) at vislibdemo.GraphSceneImpl.(GraphSceneImpl.java:34) at vislibdemo.Main.initComponents(Main.java:39) at vislibdemo.Main.(Main.java:28) at vislibdemo.Main.main(Main.java:22) Caused by: java.lang.ClassNotFoundException: org.openide.util.LookupListener at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 7 more

我想我的库有问题……但我完全按照教程说的那样添加了它们.我是 Java 新手,所以我不知道出了什么问题.如果你有一个解决方案的开始......我在 Windows 7 上使用 Netbeans 6.9.

I guess I got a problem with the libraries... but I added them exactly as the tutorial said I should. I'm quite new in Java, so I have no idea what's wrong. If you had even the beginning of a solution... I'm using Netbeans 6.9 on Windows 7.

感谢您提供的所有帮助.

Thanks for all the help you could provide.

推荐答案

好吧...看起来我找到了可能的答案.我链接的教程使用ImageUtilities.loadImage",奇怪的是,它似乎不起作用.您必须使用 Utilities.loadImage.然后,它起作用了!(Yeeehaw !)如果我想办法通知制作教程的人,我会告诉他.

All right... looks like I found a possible answer. The Tutorial I linked uses "ImageUtilities.loadImage", which, strangely enough, seems not to work. You have to use Utilities.loadImage. And then, it works ! (Yeeehaw !) If I find a way to notify the guy who made the tutorial, I'll tell him.

如果有人遇到同样的问题,这可能不是最好的解决方案,但如果您来自一切行之有效"的学校,请帮助自己.

If anybody has the same trouble, this might not be the best solution, but if you are from the "whatever works" school, help yourself.

这篇关于Netbeans 可视化库和 java.lang.NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆