使用SSH的Andr​​oid编程 [英] Using SSH Programmatically Android

查看:181
本文介绍了使用SSH的Andr​​oid编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用SSH从我工作的一个Android应用程序连接到我自己的服务器,但是我不能为我的生命得到它的工作,我已经尝试了许多不同的东西,包括JSch,但是我不能让这个工作,我每次尝试的事情具有相同的错误结束:

I am trying to use SSH to connect to my own server from an Android application I am working on, however I cannot for the life of me get it to work, I have tried many different things including JSch, however I cannot get this to work, every thing I try ends up with the same error:

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,并能够执行命令

I would like to either figure out a way to get this method to work, or figure out any other way to use SSH in an Android application, and be able to execute commands

推荐答案

在Eclipse中:

Project > Properties > Java Build Path > Order and Export > Check jsch and jzlib

这篇关于使用SSH的Andr​​oid编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆