在运行Android的一个可执行的JAR [英] Running an executable jar in android

查看:169
本文介绍了在运行Android的一个可执行的JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是有可能运行在Android中可执行的JAR文件(基于命令行的)? 我的一个朋友告诉我,这是可能的运行用C编写的可执行文件有可能是java的呢?我将通过亚行的shell运行该工具。

is it possible to run an executable jar file (command line based) in android? one of my friend told me that it is possible to run executables written in C. Is it possible for java too? I will run the tool through adb shell.

推荐答案

您可以通过安装内置亚行作为一个APK的应用程序:

You can install an app built as an APK through adb:

adb install my_apk_file.apk

而一旦亚行的shell里面,你可以使用(上午)命令启动一个APK应用程序。 <一href="http://stackoverflow.com/questions/4567904/how-to-start-an-application-using-android-adb-tools">See这个堆栈溢出文章

And once inside an adb shell, you can launch an APK application using the am command. See this Stack Overflow article

但我不认为有一种方式来直接运行一个jar文件,你可以在桌面操作系统这样做的方式,因为Android不使用标准的Java虚拟机。

But I don't think there's a way to directly run a jar file the way you can do so on a desktop operating system, because Android doesn't use the standard Java VM.

我想你会需要嵌入里面最小的Andr​​oid应用程序调用的罐子并打印结果到stdout的.jar文件。然后,你将建立一个APK安装/运行它,因为我上面描述。

I think you would need to embed your .jar file inside a minimal Android application that invokes the jar and prints results to stdout. Then you would build that APK and install/run it as I described above.

这篇关于在运行Android的一个可执行的JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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