flathub / org.freedesktop.Sdk.Extension.openjdk17

https://flathub.org/apps/details/org.freedesktop.Sdk.Extension.openjdk17
12 stars 7 forks source link

Error java not fount on build #13

Closed MessiasLima closed 1 year ago

MessiasLima commented 1 year ago

I'm trying to run a local build but I'm getting a error message saying the java is not found.

This the manifest

---
app-id: io.github.appoutlet.GameOutlet
runtime: org.freedesktop.Platform
runtime-version: '22.08'

sdk: org.freedesktop.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.openjdk17

command: gameoutlet

finish-args:
  - --env=PATH=/app/jre/bin:/usr/bin
  - --env=JAVA_HOME=/app/jre/bin

modules:

  - name: openjdk
    buildsystem: simple
    build-commands:
      - /usr/lib/sdk/openjdk17/install.sh

  - name: GameOutlet
    buildsystem: simple
    build-commands:
      - ./gradlew packageReleaseUberJarForCurrentOS
      - cp build/compose/jars/GameOutlet-*.jar /app/bin
    sources:
      - type: git
        url: https://github.com/AppOutlet/GameOutlet.git
        branch: main

This the output

messias@messias:~/Workspace/flathub$ flatpak-builder build-dir io.github.appoutlet.GameOutlet.yml --force-clean
Downloading sources
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /home/messias/Workspace/flathub/.flatpak-builder/git/https_github.com_AppOutlet_GameOutlet.git-X1ZU31/
Fetching git repo https://github.com/AppOutlet/GameOutlet.git, ref refs/heads/main
remote: Enumerating objects: 261, done.
remote: Counting objects: 100% (261/261), done.
remote: Compressing objects: 100% (227/227), done.
remote: Total 261 (delta 53), reused 130 (delta 19), pack-reused 0
Receiving objects: 100% (261/261), 440.99 KiB | 2.41 MiB/s, done.
Resolving deltas: 100% (53/53), done.
From https://github.com/AppOutlet/GameOutlet
 * [new branch]      main       -> main
 * [new tag]         v1.0.1     -> v1.0.1
Initializing build dir
Committing stage init to cache
Starting build of io.github.appoutlet.GameOutlet
========================================================================
Building module openjdk in /home/messias/Workspace/flathub/.flatpak-builder/build/openjdk-1
========================================================================
Running: /usr/lib/sdk/openjdk17/install.sh
Committing stage build-openjdk to cache
========================================================================
Building module GameOutlet in /home/messias/Workspace/flathub/.flatpak-builder/build/GameOutlet-1
========================================================================
Switched to branch 'main'
Running: ./gradlew packageReleaseUberJarForCurrentOS

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Error: module GameOutlet: Child process exited with code 1

Am doing something wrong?

MessiasLima commented 1 year ago

I have added

  "build-options": {
    "append-path": "/app/jdk/bin"
  },

and it worked