类存在时ClassNotFoundException

时间:2011-06-12 18:03:08

标签: eclipse classnotfoundexception

我正在尝试使用cheng81的Android-Bluetooth-Simulator。

我继续获取ClassNotFoundException。 我已经检查过,带有类的jar文件包含在项目的构建路径中。 我扫描了jar文件,检查是否有类,并找到了它。

我可能做错了什么?

Uncaught handler: thread main exiting due to uncaught exception
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{dk.itu.android.btemu/dk.itu.android.btemu.BTEnableControl}: java.lang.ClassNotFoundException: dk.itu.android.btemu.BTEnableControl in loader dalvik.system.PathClassLoader@44c067f0
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
       at android.app.ActivityThread.access$2200(ActivityThread.java:119)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:123)
       at android.app.ActivityThread.main(ActivityThread.java:4363)
       at java.lang.reflect.Method.invokeNative(NativeMethod)
       at java.lang.reflect.Method.invoke(Method.java:521)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
       at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: dk.itu.android.btemu.BTEnableControl in loader dalvik.system.PathClassLoader@44c067f0
       at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
       at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
       ... 11 more

搜索:

E:\Documents and Settings\Jonathan\Desktop\Firefox Downloads>java -jar jarscan.
ar -dir "E:\Program Files\Android\cheng81-Android-Bluetooth-Simulator-68aca94"
class BTEnableControl

=========================
JarScan
written by Geoff Yaworski
gyaworski@hotmail.com
Version 2.0
=========================

Will start search from: E:\Program Files\Android\cheng81-Android-Bluetooth-Simu
ator-68aca94

Looking for class(es): [BTEnableControl]

Processed 0 directories containing 2 files
found 2 libraries under the directory: E:\Program Files\Android\cheng81-Android
Bluetooth-Simulator-68aca94

1) btsim.jar [E:\Program Files\Android\cheng81-Android-Bluetooth-Simulator-68ac
94\btsim.jar]
2) btsimserver.jar [E:\Program Files\Android\cheng81-Android-Bluetooth-Simulator
-68aca94\btsimserver.jar]

searching these jarfiles now ....

===============================================
Found: BTEnableControl
Class: dk.itu.android.btemu.BTEnableControl
Package: dk.itu.android.btemu
Library Name: btsim.jar
Library Path: E:\Program Files\Android\cheng81-Android-Bluetooth-Simulator-68ac
94\btsim.jar
===============================================

0 个答案:

没有答案