运行 Netbeans 6.8 应用程序时出现 NoClassDefFoundError

发布于 2024-08-30 05:47:38 字数 761 浏览 8 评论 0原文

当我从 NetBeans 中运行应用程序时,我的应用程序最近开始抛出 NoClassDefFoundError 错误。它以前从未这样做过。

当我使用 NetBeans 构建后提供的命令行参数在 NetBeans 外部运行此命令时,不会产生这些错误。

这是 Netbeans 的错误吗?

我已经重新安装了 NetBeans,因为我最近又安装了另一个 NetBeans,但问题仍然存在。

java中的符号错误将共享项目添加到库时使用 netbeans 6.8 的应用程序

在 Netbeans 内

替代文本 http://inverse.seednet.eu/snaps/ojtjal.png

NetBeans 外部 替代文本 http://inverse.seednet.eu/snaps/gdwb5y.png

My application has recently started throwing NoClassDefFoundError errors when I am running my application from within NetBeans. It never used to do this.

And when I run this outside of NetBeans using the command line argument that it provides once built, these errors are not produced

Is this a bug with Netbeans?

I have reinstalled NetBeans as I recently had another that was resolved by reinstalling, however the problem still persists.

Symbol error in java application using netbeans 6.8 when adding a shared project to library

Within Netbeans

alt text http://inverse.seednet.eu/snaps/ojtjal.png

Outside NetBeans
alt text http://inverse.seednet.eu/snaps/gdwb5y.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

浮世清欢 2024-09-06 05:47:38

问题在于从 netbeans 运行运行配置时的运行时类路径。确保您的运行配置具有包含这些类的 jar

The issue is the run time classpath of the run configuration when you are running it from netbeans. Make sure your run config has the jar containing these classes

(り薆情海 2024-09-06 05:47:38

我的解决方案包括在项目属性/运行中设置主类。在该窗口中单击“浏览”以查看所有类。就我而言,主类消失了,为了让它重新出现,我向主类添加了语法错误,重新构建,更正错误,重新构建,然后我就能够正确设置主类。

My solution consisted of setting the Main Class in Project Properties/Run. In that window click Browse to see all classes. In my case the main class was gone, to get it to reappear I added a syntax error to the main class, rebuilt, corrected the mistake, rebuilt, and then I was able to set the main class properly.

ペ泪落弦音 2024-09-06 05:47:38

所以我也遇到了这个问题。我阅读了上面的 Temp_user 解决方案,并做了类似的事情,尽管我的主类存在于项目属性/运行中。我的课程由四个独立的课程组成。经过每一步,添加语法错误,清理和构建,更正语法错误并再次清理和构建后,程序就可以工作了。我真的不明白这是如何解决任何问题的。任何见解将不胜感激。

So I had this problem as well. I read Temp_user's solution above, and did something similar, though my main class was present in Project Properties/Run. My program consisted of four separate classes. After going through each, adding a syntax error, clean and build, correcting the syntax error and cleaning and building again, the program works. I don't really understand how this fixed anything. Any insight would be appreciated.

被翻牌 2024-09-06 05:47:38

我遇到了同样的问题,突然出现 NoClassDefFoundError 。
在我的例子中,导致问题的原因似乎是在静态上下文中初始化处理程序。虽然我以前已经成功地做到了这一点。这个特定的实例导致了以下异常:

10:45:08.196    19376   com.certhon.activities  ERROR   QualiflexApp    Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

解决这个问题也解决了NoClassDefFoundError,也许处理程序导致应用程序初始化故障或其他什么?

我不太确定出了什么问题,或者这是否会对任何人有帮助,但是,分享也没什么坏处吧?

I had the same problem, NoClassDefFoundError out of the blue.
What seems to have caused the problem in my case was initializing a Handler in a static Context. Although i have done this succesfully before. this specific instance caused the following exception:

10:45:08.196    19376   com.certhon.activities  ERROR   QualiflexApp    Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

Solving this also solved the NoClassDefFoundError, maybe the the handler causes app initialization to malfunction or something?

Im not very sure what went wrong or if this will help anyone, but, can't hurt to share right?

流年里的时光 2024-09-06 05:47:38

我们已将 jar 库正确添加到项目库中并且工作正常。然后,突然间,它因这个错误而停止工作。

解决方法:

 1. Delete build and dist folders in the Project.
 2. Remove and add the library back to Project - Libraries. 
 3. Rebuild Project.

We had jar-library correctly added to Project Libraries and working fine. Then, suddenly, it stopped working with this error.

To solve:

 1. Delete build and dist folders in the Project.
 2. Remove and add the library back to Project - Libraries. 
 3. Rebuild Project.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文