Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolchain issues #10

Closed
Giszmo opened this issue May 9, 2024 · 5 comments
Closed

toolchain issues #10

Giszmo opened this issue May 9, 2024 · 5 comments

Comments

@Giszmo
Copy link

Giszmo commented May 9, 2024

$ ./gradlew jpackage

> Configure project :pacman-ui-fx-2d
Operating System: name='Linux' version='6.1.0-13-amd64' arch='amd64'

> Configure project :pacman-ui-fx-3d
Operating System: name='Linux' version='6.1.0-13-amd64' arch='amd64'
Path for java installation '/usr/lib/jvm/openjdk-17' (Common Linux Locations) does not contain a java executable
Path for java installation '/usr/lib/jvm/openjdk-11' (Common Linux Locations) does not contain a java executable

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':pacman-core:compileJava'.
> Could not resolve all dependencies for configuration ':pacman-core:compileClasspath'.
   > Failed to calculate the value of task ':pacman-core:compileJava' property 'javaCompiler'.
      > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=21, vendor=any, implementation=vendor-specific} for LINUX on x86_64.
         > No locally installed toolchains match and toolchain download repositories have not been configured.

* Try:
> Learn more about toolchain auto-detection at https://docs.gradle.org/8.7/userguide/toolchains.html#sec:auto_detection.
> Learn more about toolchain repositories at https://docs.gradle.org/8.7/userguide/toolchains.html#sub:download_repositories.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 452ms
$ echo $JAVA_HOME 
/usr/lib/jvm/java-17-openjdk-amd64/
$ ll $JAVA_HOME 
total 48K
drwxr-xr-x  9 root root 4.0K Nov 13 12:41 .
drwxr-xr-x  6 root root 4.0K Nov 13 12:41 ..
drwxr-xr-x  2 root root 4.0K Nov 13 12:41 bin
drwxr-xr-x  4 root root 4.0K Nov 13 12:41 conf
lrwxrwxrwx  1 root root   42 May  2  2022 docs -> ../../../share/doc/openjdk-17-jre-headless
drwxr-xr-x  3 root root 4.0K Nov 13 12:41 include
drwxr-xr-x  2 root root  12K Nov 13 12:41 jmods
drwxr-xr-x 72 root root 4.0K Jul 11  2022 legal
drwxr-xr-x  5 root root 4.0K Nov 13 12:41 lib
drwxr-xr-x  3 root root 4.0K Jul 11  2022 man
-rw-r--r--  1 root root 1.2K Oct 31  2023 release
$ java --version
openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment (build 17.0.9+9-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.9+9-Debian-1deb12u1, mixed mode, sharing)
@armin-reichert
Copy link
Owner

Hello,

thanks for your message!

I have no real Linux installation available on my PC, only a VMware virtual machine.

My guess is that you need a Java 21 JDK to compile and build everything (I changed from 17->21 some time ago.)

Could you please try and tell me if it works?

Best regards
Armin

@Giszmo
Copy link
Author

Giszmo commented May 9, 2024

I've been struggling to install JDK21 since before your quick answer and it appears to still not be very available. At least not in the form I would be willing to install it for this quick test of your game.

gradle/gradle#22921 appears relevant, too.

$ sudo apt install openjdk-21-jdk
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libglib2.0-0t64 : Depends: libc6 (>= 2.38) but 2.36-9+deb12u3 is to be installed
                   Depends: libmount1 (>= 2.40~rc2) but 2.38.1-5+b1 is to be installed
 libgtk-3-0t64 : Depends: libatk-bridge2.0-0t64 (>= 2.15.1) but it is not going to be installed
                 Depends: libatk1.0-0t64 (>= 2.35.1) but it is not going to be installed
                 Depends: libcloudproviders0 (>= 0.3.2) but 0.3.1-2 is to be installed
                 Depends: libcups2t64 (>= 1.7.0) but it is not installable
                 Depends: libgtk-3-common (>= 3.24.41-4) but 3.24.38-2~deb12u1 is to be installed
 openjdk-21-jre : Depends: libcups2t64 but it is not installable
                  Depends: libasound2t64 (>= 1.0.16)
E: Unable to correct problems, you have held broken packages.

@armin-reichert
Copy link
Owner

I quickly tried: I cannot build the project in my Linux VM (Ubuntu) either.

But I have just published a new release (which triggers a build on the GitHub build infrastructure) and there a .deb file has been created, see https://github.com/armin-reichert/pacman-javafx/releases/tag/2024-05-09

I installed this .deb file on my Ubuntu VM image using the software installer, the executable is located under /opt/pacman-javafx-3d/bin. I can run the application in my VMware image.

Could you download and install this .deb archive and tell me if it works?

@Giszmo
Copy link
Author

Giszmo commented May 9, 2024

Sorry, I can't try it out now. For me this issue is ok to close.

@armin-reichert
Copy link
Owner

armin-reichert commented May 9, 2024

Tried again to build on my Ubuntu VM (after changing settings.gradle, not sure about the change).

Issue 1: See fvarrui/JavaPackager#135
Solution: Install binutils: sudo apt-get install binutils

Issue 2: fakeroot command not found
Solution: sudo apt-get install fakeroot

Now, ./gradlew jpackageruns successfully. In the build/jpackage folders of the subprojects, deb-files are created. The build/jpackage/pacman-javafx-2d/binfolder contains an executable. (Same for 3D subproject).

deb-file can be installed using software install (Right-click -> "Open with other application" -> "Software Install"). The applications unfortunately don't appear in the "Show Applications" window. They can however be found in the /opt folder.

Alternative: Build using Maven:
mvnw clean install -Pbuild-for-linux. The generated artifacts are found in the targetfolders of the subprojects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants