Where is the JAVA_HOME for flatpak openjdk17?

I am running silverblue fc43 on aarch64 and want to install a java app that requires JRE, so I have installed flatpak org.freedesktop.Sdk.Extension.openjdk17.
But the app installer needs to know where is the JRE; what is the correct value for INSTALL4J_JAVA_HOME?

logs
lini@fsb:~$ flatpak info org.freedesktop.Sdk.Extension.openjdk17

OpenJDK 17 SDK Extension - The LTS (long term support) version of the OpenJDK
JRE and JDK

          ID: org.freedesktop.Sdk.Extension.openjdk17
         Ref: runtime/org.freedesktop.Sdk.Extension.openjdk17/aarch64/20.08
        Arch: aarch64
      Branch: 20.08
     License: 0BSD AND Apache-1.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND FTL AND GPL-2.0 AND GPL-2.0-with-classpath-exception AND IJG AND ISC AND LGPL-2.1-or-later AND MIT AND MPL-2.0 AND RSA-MD AND SAX-PD AND W3C AND Zlib
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 668.9 MB

      Commit: 3f0ef5db4befd16531f8e241cd1d63d938df3fdc9f1cafe93a097ae835253627
      Parent: a235e3f999966274a33e2eded61d187bc0e914d70392d3e0e580a85734b67d40
     Subject: Update to OpenJDK 17.0.1 (4360bb90)
        Date: 2022-01-15 23:32:32 +0000
lini@fsb:~/Downloads$ sh ./PDFStudio_unix.sh 
No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 9 and at most 19.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

I’m not a Java expert and I don’t know if PDF Studio will work properly, but with the following steps I was likely at least able to install it on an x86_64 Fedora Silverblue 43 machine.

  • Create (if you haven’t already) and enter into a toolbox container:
    toolbox enter

  • Install OpenJDK:
    sudo dnf install --assumeyes java-latest-openjdk.x86_64

  • Get PDF Studio Latest Version for Linux.

  • Run the installer:
    sh ./PDFStudio_linux64.sh

Please be aware that I running on aarch64 architecture so I doesnt look like I can install x86_64 even inside toolbox:

log

lini@toolbx ~]$ sudo dnf install --assumeyes java-latest-openjdk.x86_64
Updating and loading repositories:
Fedora 43 - aarch64 - Updates 100% | 3.2 MiB/s | 6.5 MiB | 00m02s
Fedora 43 openh264 (From Cisco) - aarch64 100% | 3.5 KiB/s | 5.8 KiB | 00m02s
Fedora 43 - aarch64 100% | 4.0 MiB/s | 34.2 MiB | 00m09s
Repositories loaded.
Failed to resolve the transaction:
No match for argument: java-latest-openjdk.x86_64
You can try to add to command line:
–skip-unavailable to skip unavailable packages

I am quite well aware that you are using AArch64 architecture and I have explicitly stated that the above instructions are for an x86-64 machine.

The java-latest-openjdk package is indeed available for aarch64:

$ dnf repoquery --forcearch=aarch64 --arch=aarch64 java-latest-openjdk
Updating and loading repositories:
Repositories loaded.
java-latest-openjdk-1:24.0.2.0.12-3.rolling.fc43.aarch64
java-latest-openjdk-1:25.0.1.0.8-0.1.fc43.aarch64

So, in your case, just omit the .x86_64 suffix from the command, i.e. type sudo dnf install --assumeyes java-latest-openjdk or explicitly install the java-latest-openjdk-1:25.0.1.0.8-0.1.fc43.aarch64 package.

I can’t currently test installing the java-latest-openjdk package on an AArch64 machine, but I think it should work.

You can not use the content of a Flatpak app or runtime to easily run things from your host.

As Hristo said, you should install all of this in a toolbox container.

Ok, I got it working, maybe not the most elegant approach but it does the job :slight_smile:

  1. forget about dnf or flatpak packaged java JVM
  2. download free JVM: OpenJDK19U-jdk_aarch64_linux_hotspot_19.0.2_7.tar.gz
  3. untar it in ~/Downloads and then simply install pdf studio as below
Installation

lini@fsb:~$ export INSTALL4J_JAVA_HOME=/var/home/lini/Downloads/jdk-19.0.2+7
lini@fsb:~$ cd Downloads/
lini@fsb:~/Downloads$ sh ./PDFStudio_unix.sh
Starting Installer …
lini@fsb:~/Downloads$ ll
total 608204
drwxr-xr-x. 1 lini lini 86 Jan 18 2023 jdk-19.0.2+7
-rw-r–r–. 1 lini lini 198657357 Dec 13 19:11 OpenJDK19U-jdk_aarch64_linux_hotspot_19.0.2_7.tar.gz
-rw-r–r–. 1 lini lini 120121787 Dec 11 20:53 PDFStudio_unix.sh

Thanks a lot for supporting!

1 Like