Kivy Apk build with buildozer错误:找不到Java编译器(javac),请安装i

2024-05-20 08:21:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图建立一个我的基维项目的apk。 我使用PyCharm在python 2.7中安装了buildozer,然后构建了.spec, 但当我尝试创建apk时,我得到了以下结果: 我查过jdk7和8

  1. 使用:buildozer Android debug

    #Check configuration tokens
    # Ensure build layout
    # Check configuration tokens
    # Preparing build
    # Check requirements for android
    # Java compiler (javac) not found, please install it.
    
  2. 使用:buildozer -v Android debug

    # Check configuration tokens
    # Ensure build layout
    # Check configuration tokens
    # Read available permissions from api-versions.xml
    # Preparing build
    # Check requirements for android
    # Run 'dpkg --version'
    # Cwd None
    /bin/sh: dpkg: comando non trovato
    # Search for Git (git)
    #  -> found at /usr/bin/git
    # Search for Cython (cython)
    #  -> found at /usr/bin/cython
    # Search for Java compiler (javac)
    # Java compiler (javac) not found, please install it.
    
  3. 使用:buildozer Android debug deploy run

    # Check configuration tokens
    # Ensure build layout
    # Check configuration tokens
    # Preparing build
    # Check requirements for android
    # Java compiler (javac) not found, please install it.
    

我怎样才能让它工作?


Tags: debugbuildforcompilercheckjavaconfigurationandroid
2条回答

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

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

这个错误看起来相当明显-安装javac。

这可能在发行版包管理器的java相关包中。它可能有搜索功能来找到你想要的那个。

相关问题 更多 >