凌云志轩
2015-09-17 08:43
采纳率: 89%
浏览 3.9k
已采纳

eclipse 导入jar包出现Could not find class

我将我的项目打包成jar,导入后出现找不到class。求教大神们。
我的打包方法:
项目右键 -> export jar,然后操作如下图图片说明然后一路往下。添加包是直接将jar拷贝到libs,build path添加。但是现在点击调用jar包里面的文件时出现如下错误

 09-17 16:35:19.311: E/hahahahha(4247): 21fe82cdac8539317a53b87e1ba7873e
09-17 16:35:20.121: E/dalvikvm(4247): Could not find class 'org.videolan.vlc.audio.AudioServiceController$1', referenced from method org.videolan.vlc.audio.AudioServiceController.<init>
09-17 16:35:20.121: E/dalvikvm(4247): Could not find class 'org.videolan.vlc.interfaces.IAudioService', referenced from method org.videolan.vlc.audio.AudioServiceController.remoteProcedureCall
09-17 16:35:20.121: E/dalvikvm(4247): Could not find class 'org.videolan.vlc.audio.AudioService', referenced from method org.videolan.vlc.audio.AudioServiceController.bindAudioService
09-17 16:35:20.141: E/MyUncaughtHandler(4247): Could not execute method of the activity
09-17 16:35:20.141: E/MyUncaughtHandler(4247): java.lang.IllegalStateException: Could not execute method of the activity
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.view.View$1.onClick(View.java:3725)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.view.View.performClick(View.java:4262)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.view.View$PerformClick.run(View.java:17351)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.os.Handler.handleCallback(Handler.java:615)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.os.Handler.dispatchMessage(Handler.java:92)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.os.Looper.loop(Looper.java:137)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.app.ActivityThread.main(ActivityThread.java:4935)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at java.lang.reflect.Method.invokeNative(Native Method)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at java.lang.reflect.Method.invoke(Method.java:511)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at dalvik.system.NativeStart.main(Native Method)
09-17 16:35:20.141: E/MyUncaughtHandler(4247): Caused by: java.lang.reflect.InvocationTargetException
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at java.lang.reflect.Method.invokeNative(Native Method)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at java.lang.reflect.Method.invoke(Method.java:511)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at android.view.View$1.onClick(View.java:3720)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  ... 11 more
09-17 16:35:20.141: E/MyUncaughtHandler(4247): Caused by: java.lang.NoClassDefFoundError: org.videolan.vlc.audio.AudioServiceController$1
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at org.videolan.vlc.audio.AudioServiceController.<init>(AudioServiceController.java:52)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at org.videolan.vlc.audio.AudioServiceController.getInstance(AudioServiceController.java:70)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  at ixz.fish_help_app.GrpDevListActivity.sys_vlc(GrpDevListActivity.java:1893)
09-17 16:35:20.141: E/MyUncaughtHandler(4247):  ... 14 more

调用的方法是

``public void sys_vlc(View view)
{
AudioServiceController c = AudioServiceController.getInstance();

c.load(VLCURL, false);

}
求教这是怎么回事呢?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

5条回答 默认 最新

  • 穆侠 2015-09-19 19:44
    已采纳

    虽然经常用,但还真没见过你这问题,也没关注怎么选导出文件选择(我一直用默认的,就OK了)。我总觉得是件导出文件没选全,那个bin是不是要选一下(好像也不用啊)。对了,各种依赖jar包所在文件夹一定要钩上,这种文件夹要手动钩的

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • Robot-C 2015-09-17 08:47

    今天同学问我双击jar包在有的机子上可以运行,但在有的机子上确没法运行,我就我遇到的问题和解决办法拿出来分享:
    1.elipse打jar包一般有两种:一种是普通的jar file,另外一种是Runnable jar file;要想可执行当然选择第二种了
    2.确人java -jar xxx.jar 在控制台或制作的bat文件中是否正常运行,如果不能正常运行说明jar包有问题;问题一般是没有......
    答案就在这里:could not find the main class win7/xp 双击执行jar包出现:could not find the main class
    ----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

    评论
    解决 无用
    打赏 举报
  • 逝_去_的_光_阴 2015-09-17 09:37

    一些依赖包没导入jar吧
    试试导出为Runnable jar file

    评论
    解决 无用
    打赏 举报
  • beaconD 2015-09-17 11:57

    缺少jar包吧?有一些依赖的jar包没有导入

    评论
    解决 无用
    打赏 举报
  • 穆侠 2015-09-19 19:46

    如果vcl全钩中还有问题,再问吧

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题