flathub / org.godotengine.Godot

Godot engine
https://flathub.org/apps/details/org.godotengine.Godot
39 stars 25 forks source link

jlink executable /app/jre/bin/jlink does not exist. #157

Closed DekosAnjo closed 8 months ago

DekosAnjo commented 8 months ago

Gradle can't find jlink because it's not include for some reason.

 FAILURE: Build failed with an exception.

  * What went wrong:
  Execution failed for task ':compileReleaseJavaWithJavac'.
  > Could not resolve all files for configuration ':androidJdkImage'.
     > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
        > Execution failed for JdkImageTransform: /home/dekos/Android/Sdk/platforms/android-33/core-for-system-modules.jar.
           > jlink executable /app/jre/bin/jlink does not exist.

/app/jre/bin/ only have java, keytool and rmiregistry image

j20001970 commented 8 months ago

155 reverted the changes that I did earlier, and JRE is now bundled with Godot flatpak instead of locating from Sdk extension (/usr/lib/sdk/openjdk17).

Since install.sh from org.freedesktop.Sdk.Extension.openjdk17 only copy {java,keytool,rmiregistry} to /app/jre/bin, most of JDK component is not included, which is required by Gradle.

One possible solution is to use installjdk.sh to bundle entire JDK, but considering that some users might not exporting with Gradle or Android at all, the final app size would be unnecessarily large.

I would suggest reverting #155 to let wrapper script locating OpenJDK by JAVA_HOME environment variable again, and update the documentation to mention installing org.freedesktop.Sdk.Extension.openjdk17 to enable Android export/Gradle build. (and modify JAVA_HOME with flatpak override if users installed different versions)

Calinou commented 8 months ago

cc @priahoud

DekosAnjo commented 8 months ago

Why not create a custom shell script to copy only what is required by Gradle?

Zishan-Rahman commented 8 months ago

I would suggest reverting #155 to let wrapper script locating OpenJDK by JAVA_HOME environment variable again, and update the documentation to mention installing org.freedesktop.Sdk.Extension.openjdk17 to enable Android export/Gradle build. (and modify JAVA_HOME with flatpak override if users installed different versions)

The PR I just opened should make it so that org.freedesktop.Sdk.Extension.openjdk17 gets installed with this Flatpak, so that the Godot Flatpak can access it, and that anyone exporting with Android doesn't have to perform the extra step of installing it.