我正在尝试使用SSH从我正在处理的Android应用程序连接到我自己的服务器,但是我不能为我的生活让它工作,我尝试了许多不同的东西,包括JSch,但我无法得到这个工作,我尝试的每件事都会出现同样的错误:
04-14 22:06:57.329: E/AndroidRuntime(5641): FATAL EXCEPTION: main
04-14 22:06:57.329: E/AndroidRuntime(5641): java.lang.NoClassDefFoundError: com.jcraft.jsch.JSch
04-14 22:06:57.329: E/AndroidRuntime(5641): at com.xynteq.terminal.LinuxCommandsActivity.executeRemoteCommand(LinuxCommandsActivity.java:51)
04-14 22:06:57.329: E/AndroidRuntime(5641): at com.xynteq.terminal.LinuxCommandsActivity.onCreate(LinuxCommandsActivity.java:25)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.os.Handler.dispatchMessage(Handler.java:99)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.os.Looper.loop(Looper.java:130)
04-14 22:06:57.329: E/AndroidRuntime(5641): at android.app.ActivityThread.main(ActivityThread.java:3835)
04-14 22:06:57.329: E/AndroidRuntime(5641): at java.lang.reflect.Method.invokeNative(Native Method)
04-14 22:06:57.329: E/AndroidRuntime(5641): at java.lang.reflect.Method.invoke(Method.java:507)
04-14 22:06:57.329: E/AndroidRuntime(5641): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
04-14 22:06:57.329: E/AndroidRuntime(5641): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
04-14 22:06:57.329: E/AndroidRuntime(5641): at dalvik.system.NativeStart.main(Native Method)
我想找到一种方法让这个方法起作用,或想出在Android应用程序中使用SSH的任何其他方法,并能够执行命令
答案 0 :(得分:2)
在Eclipse中:
Project > Properties > Java Build Path > Order and Export > Check jsch and jzlib