ClassNotFoundException 与classes.jar(java.net 包)中的URLClassLoader

发布于 2024-10-04 23:26:55 字数 1333 浏览 8 评论 0原文

在 Eclipse Galileo 上,执行 Debug As/Web Application 时出现以下 ClassNotFoundException。但在运行为/Web 应用程序时工作得很好。

我收到消息“源附件不包含文件 URLClassLoader.class 的源。您可以通过单击下面的更改附加源来更改源附件:”

在项目窗口中,URLClassLoader 类似乎来自 Java .net 包,来自 /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar。

我在机器上找到了罐子,我还缺少什么?为什么它只是调试问题?

我的 iMac 10.6.5 机器上的 JRE 系统库是否可能已过时?或者以某种方式安装/卸载某些 jar/包导致了问题?

这就是我所拥有的 - JRE 系统库 [JVM 1.6.0 (MacOS X 默认)] - 更新它是否有助于解决问题?但如何更新呢?

请帮忙!

com.google.appengine.tools.development.DevAppServerMain at localhost:57873 
 Thread [main] (Suspended (exception ClassNotFoundException)) 
  Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: 207 
  Launcher$ExtClassLoader.findClass(String) line: 229 
  Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: 307 
  Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 296 
  Launcher$AppClassLoader.loadClass(String, boolean) line: 301 
  Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 248 
  InstrumentationImpl.loadClassAndStartAgent(String, String, String) line: 280 
  InstrumentationImpl.loadClassAndCallPremain(String, String) line: 338 
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java (Nov 30, 2010 9:40:41 PM) 

On Eclipse Galileo, got the following ClassNotFoundException when doing Debug As/Web Application. But works just fine when doing Run As/Web Application.

I was given message that "The source attachment does not contain the source for the file URLClassLoader.class. You can change the source attachment by clicking the Change Attached Source below:"

In the project window, it seems that the URLClassLoader class is from Java.net package, which is from /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar.

I found the jar on the machine, what else I am missing? why it's debug only issue?

Could it be possible that the JRE system library that I have on my iMac 10.6.5 machine is outdated? Or somehow install/unstall of some jar/package caused the issue?

This is what I have - JRE System Library [JVM 1.6.0 (MacOS X Default)] - would update it help fixing the issue? but how to get it updated?

Please help!

com.google.appengine.tools.development.DevAppServerMain at localhost:57873 
 Thread [main] (Suspended (exception ClassNotFoundException)) 
  Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: 207 
  Launcher$ExtClassLoader.findClass(String) line: 229 
  Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: 307 
  Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 296 
  Launcher$AppClassLoader.loadClass(String, boolean) line: 301 
  Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 248 
  InstrumentationImpl.loadClassAndStartAgent(String, String, String) line: 280 
  InstrumentationImpl.loadClassAndCallPremain(String, String) line: 338 
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java (Nov 30, 2010 9:40:41 PM) 

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

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

发布评论

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

评论(1

别再吹冷风 2024-10-11 23:26:55

也许你需要安装有完整源码的JDK?请参阅 Apple 网站 下载最新的 JDK,可能需要 Apple ID。

之后,相应地更改 eclipse 的 java 运行时以使用新安装的 JDK:

在此处输入图像描述

并重新构建您的项目: Project ->来源->清理

Perhaps you need to install JDK which has complete sources? Refer to Apple website to download the latest JDK, might need an Apple ID.

After that change eclipse's java runtime accordingly to use the new installed JDK:

enter image description here

And re-build your project: Project -> Source -> Clean-up

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文