【问题标题】:How to install javac on Linux Mint如何在 Linux Mint 上安装 javac
【发布时间】:2021-06-25 10:31:04
【问题描述】:

我用Python for android写了一段小代码,编译apk文件中的代码时出现错误

# Java compiler (javac) not found, please install it.

写说需要安装javaс。我已经安装了java 14.0.2,但仍然出现错误。我在 Linux Mint 中完成所有这些,如果你在控制台中编写 java,它将给出以下内容:

Usage: javac <options> <source files>
where possible options include:


@<filename>                  Read options and filenames from file
  -Akey[=value]                Options to pass to annotation processors
  --add-modules <module>(,<module>)*
        Root modules to resolve in addition to the initial modules, or all modules
        on the module path if <module> is ALL-MODULE-PATH.
  --boot-class-path <path>, -bootclasspath <path>
        Override location of bootstrap class files
  --class-path <path>, -classpath <path>, -cp <path>
        Specify where to find user class files and annotation processors
  -d <directory>               Specify where to place generated class files
  -deprecation
        Output source locations where deprecated APIs are used
  --enable-preview
        Enable preview language features. To be used in conjunction with either -source or --release.
  -encoding <encoding>         Specify character encoding used by source files
  -endorseddirs <dirs>         Override location of endorsed standards path
  -extdirs <dirs>              Override location of installed extensions
  -g                           Generate all debugging info
  -g:{lines,vars,source}       Generate only some debugging info
  -g:none                      Generate no debugging info
  -h <directory>
        Specify where to place generated native header files
  --help, -help, -?            Print this help message
  --help-extra, -X             Print help on extra options
  -implicit:{none,class}
        Specify whether or not to generate class files for implicitly referenced files
  -J<flag>                     Pass <flag> directly to the runtime system
  --limit-modules <module>(,<module>)*
        Limit the universe of observable modules
  --module <module>(,<module>)*, -m <module>(,<module>)*
        Compile only the specified module(s), check timestamps
  --module-path <path>, -p <path>
        Specify where to find application modules
  --module-source-path <module-source-path>
        Specify where to find input source files for multiple modules
  --module-version <version>
        Specify version of modules that are being compiled
  -nowarn                      Generate no warnings
  -parameters
        Generate metadata for reflection on method parameters
  -proc:{none,only}
        Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...]
        Names of the annotation processors to run; bypasses default discovery process
  --processor-module-path <path>
        Specify a module path where to find annotation processors
  --processor-path <path>, -processorpath <path>
        Specify where to find annotation processors
  -profile <profile>
        Check that API used is available in the specified profile
  --release <release>
        Compile for the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14
  -s <directory>               Specify where to place generated source files
  --source <release>, -source <release>
        Provide source compatibility with the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14
  --source-path <path>, -sourcepath <path>
        Specify where to find input source files
  --system <jdk>|none          Override location of system modules
  --target <release>, -target <release>
        Generate class files suitable for the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14
  --upgrade-module-path <path>
        Override location of upgradeable modules
  -verbose                     Output messages about what the compiler is doing
  --version, -version          Version information
  -Werror                      Terminate compilation if warnings occur

帮我解决问题。提前谢谢!

【问题讨论】:

  • 我看不出与 Python 有任何关系。此外,这将有助于有一个具体的步骤列表来重现您的问题。作为新用户,也可以使用tour 并阅读How to Ask
  • 问题不在 Python 中,而是在没有 javac 的情况下推土机无法工作,由于某种原因没有安装在 linux mint 上

标签: python apk buildozer


【解决方案1】:

您需要安装 Java 开发工具包。如果您使用的是基于 Debian 的系统(Ubuntu、Linux mint 等),只需在终端输入:sudo apt-get install openjdk-8-jdk。在 windows 上,你必须访问 Java 网站并手动下载 Java JDK。

要检查您是否安装了 Java JDK,请在控制台输入 javac -version,您应该会看到如下消息:javac 1.8.0_91

【讨论】:

猜你喜欢
  • 2022-10-22
  • 2017-01-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-03
  • 2014-07-15
  • 2018-03-06
相关资源
最近更新 更多