【问题标题】:Is it possible to install Java SDK in Termux?是否可以在 Termux 中安装 Java SDK?
【发布时间】:2020-09-16 22:26:25
【问题描述】:

我在尝试在我的 Android 设备上安装 Java SDKs 时遇到问题。

我需要安装它才能在Termux 中使用apktool。我在许多论坛甚至 YouTube 上进行了调查,但我无法解决我的问题。我用了这个script,但它也对我不起作用;我得到Bad system call。我已经安装了apktool,但是我缺少Java 插件才能正常工作。谁能帮帮我?

【问题讨论】:

  • Java 安装脚本走了多远?有没有安装什么东西?无论如何,您为什么需要在 Termux 中运行它?你不能把你的 .apk 文件复制到一台真实的电脑上吗?
  • 脚本显然运行正确,因为它没有显示任何错误。但是当输入java 命令时,我得到了上述错误。我需要在 Termux 中使用它,因为我有一个可以使用 apktool 的项目,并且我想让它与 Android 用户兼容。
  • 我认为这是 Termux 人的问题:/“错误的系统调用”消息通常出现,因为应用程序已使用与平台不匹配的编译器或编译器设置进行编译。我怀疑这是否可以在 Java 级别修复。对不起。
  • 正如你提到的,你主要关心的是 apktool 然后试试这个GitHub.com/Hax4Us/Apkmod

标签: java android apktool termux


【解决方案1】:

它正在这款平板电脑上运行。其他平板电脑仍然不行。

$ java
Usage: java [options] <mainclass> [args...]
           (to execute a class)
   or  java [options] -jar <jarfile> [args...]
           (to execute a jar file)
   or  java [options] -m <module>[/<mainclass>] [args...]
       java [options] --module <module>[/<mainclass>] [args...]
           (to execute the main class in a module)

 Arguments following the main class, -jar <jarfile>, -m or --module
 <module>/<mainclass> are passed as the arguments to main class.

 where options include:

    -d32          Deprecated, will be removed in a future release
    -d64          Deprecated, will be removed in a future release
    -client       is a synonym for the "server" VM  [deprecated]
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    --class-path <class search path of directories and zip/jar files>
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -p <module path>
    --module-path <module path>...
                  A : separated list of directories, each directory
                  is a directory of modules.
    --upgrade-module-path <module path>...
                  A : separated list of directories, each directory
                  is a directory of modules that replace upgradeable
                  modules in the runtime image
    --add-modules <module name>[,<module name>...]
                  root modules to resolve in addition to the initial module.
                  <module name> can also be ALL-DEFAULT, ALL-SYSTEM,
                  ALL-MODULE-PATH.
    --list-modules
                  list observable modules and exit
    -d <module name>
    --describe-module <module name>
                  describe a module and exit
    --dry-run     create VM and load main class but do not execute main method.
                  The --dry-run option may be useful for validating the
                  command-line options such as the module system configuration.
    --validate-modules
                  validate all modules and exit
                  The --validate-modules option may be useful for finding
                  conflicts and other errors with modules on the module path.
    -D<name>=<value>
                  set a system property
    -verbose:[class|module|gc|jni]
                  enable verbose output
    -version      print product version to the error stream and exit
    --version     print product version to the output stream and exit
    -showversion  print product version to the error stream and continue
    --show-version
                  print product version to the output stream and continue
    --show-module-resolution
                  show module resolution output during startup
    -? -h -help
                  print this help message to the error stream
    --help        print this help message to the output stream
    -X            print help on extra options to the error stream
    --help-extra  print help on extra options to the output stream
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:jdwp
                  see also -agentlib:jdwp=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
                  HiDPI scaled images are automatically supported and used
                  if available. The unscaled image filename, e.g. image.ext,
                  should always be passed as the argument to the -splash option.
                  The most appropriate scaled image provided will be picked up
                  automatically.
                  See the SplashScreen API documentation for more information
    @argument files
                  one or more argument files containing options
    -disable-@files
                  prevent further argument file expansion
To specify an argument for a long option, you can use --<name>=<value> or
--<name> <value>.

更多详情请参阅this

【讨论】:

    【解决方案2】:

    https://archive.org/download/openjdk-9-jre-headless_9.2

    在 arm 和 aarch64 上工作 似乎最好先安装jre ....

    【讨论】:

      猜你喜欢
      • 2013-08-27
      • 2014-07-25
      • 2014-07-25
      • 1970-01-01
      • 2012-03-03
      • 2012-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多