Qt 5.6 with Android Studio (embedded JDK)



  • Hi all,
    I'm configuring Qt 5.6.2 on my new debian 8 installation.
    I just installed the latest Android Studio 2.3.1 that has JDK embedded on the package.
    Then from the package manager I installed NDK.

    From Qt Creator I configured Android as:

    JDK location:  /home/luca/android-studio/jre
    Android SDK location: /home/luca/Android/Sdk
    Android NDK location: /home/luca/Android/Sdk/ndk-bundle
    

    The problem is when I build, at the end of compilation I get:

    :compileReleaseJava FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':compileReleaseJava'.
    > Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
    

    In my previous linux system I've never set JAVA_HOME and all worked fine...
    Where do I wrong with Debian?

    Thanks

    Luca


  • Moderators

    @luca said in Qt 5.6 with Android Studio (embedded JDK):

    /home/luca/android-studio/jre

    This is the path to the Java JRE not JDK. JRE does not contain the compiler.
    Change the path, so it points to the JDK.



  • Then new Android Studio cames with a full JDK and it put all in /jre . It also contains javac ecc...



  • Ok, it seems Android Studio embed OpenJDK 8 in its /jre folder but Qt Creator (Qt 5.6.2) can't use it.

    To solve I installed OpenJDK 8 on my system and configured Qt Creator as:

    JDK location:  /usr/lib/jvm/java-1.8.0-openjdk-amd64
    

Log in to reply