To build in clean chroot when cannot run archlinux-java set java-17-openjdk
.
- use
java-environment=17
inmakedepends
- move
depends
array insidepackage()
function
Git Clone URL: | https://aur.archlinux.org/mindustry-git.git (read-only, click to copy) |
---|---|
Package Base: | mindustry-git |
Description: | A sandbox tower defense game written in Java |
Upstream URL: | https://github.com/Anuken/Mindustry |
Keywords: | game multiplayer sandbox |
Licenses: | GPL3 |
Conflicts: | mindustry |
Provides: | mindustry |
Submitter: | copygirl |
Maintainer: | copygirl |
Last Packager: | copygirl |
Votes: | 12 |
Popularity: | 0.000243 |
First Submitted: | 2018-02-06 11:36 (UTC) |
Last Updated: | 2022-03-19 08:09 (UTC) |
To build in clean chroot when cannot run archlinux-java set java-17-openjdk
.
java-environment=17
in makedepends
depends
array inside package()
function@copygirl
Ok, I managed to fix it. It was indeed a mistake I made myself.
I changed to java-14-opendjk
via archlinux-java
, even though I only installed the runtime environments and not the jdk itself.
Since there were still other Java versions installed (8 and 10), I guess gradle tried to use those old jdks as a fallback?
Anyway, the issue has been fixed and everything works perfectly fine.
I'm sorry for any inconveniences. I didn't expect this whole java version juggling to be this confusing :D
Thanks for your time and this PKGBUILD!
@Nukesor: Package builds for me. The only difference I can see is the "_JAVA_OPTIONS" line. I've asked in the game's Discord to see if anyone knows more. So far setting -Djdk.attach.allowSelfAttach=true
has been suggested (which you might be able to set in _JAVA_OPTIONS
or the newer JDK_JAVA_OPTIONS
/ JAVA_TOOL_OPTIONS
?) - also something that came up when searching for your error.
The current git build fails with JDK14:
Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/nuke/.config/java Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details No Android SDK found. Skipping Android module.
Configure project : Compiling with build: 'custom build'
Task :core:compileJava FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':core:compileJava'.
Could not self-attach to current VM using external process
Try: 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.6/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 41s 4 actionable tasks: 4 executed ==> ERROR: A failure occurred in build(). Aborting... error making: mindustry-git
JDK 14 is now recommended in the README
Updated the package as by vasya's comments. Doesn't use absolute paths anymore so it respects $PATH. I decided to keep the java-runtime=8
dependency for now, as that appears to be recommended to build (and play?) as per the project's readme. If you wish, you can always change the requirement to >=
this before you build the package.
I also changed all the file and folder names to remove the -git
suffix as per recommendations in the #archlinux IRC channel, and made the package provide and conflict with other mindustry
packages. I initially intended this package to be playable alongside a stable version of the game, but as both versions would use the same configuration folder, it could cause issues.
I noticed myself that I could not build the game from the latest source code. If you run into a similar issue, try to build from the most recent release tag instead (see pinned comment and https://github.com/Anuken/Mindustry/releases), and perhaps report it to the developers.
Also, same as with the mindustry
AUR package, can you please change the java-runtime requirements from 8
to >=8
?
Can we change .desktop file to call Exec=mindustry-git
instead of /usr/bin/mindustry-git
, and the main executable to call java
instead of /usr/bin/java
? This is the preferred way I think. The user might want to override the binaries in e.g. /usr/local/bin
, and it makes sense to allow it. Also, this is how all other .desktop behave as far as I see.
Thanks for the package!
Pinned Comments
copygirl commented on 2019-04-22 00:56 (UTC) (edited on 2020-10-17 08:29 (UTC) by copygirl)
Please note that this package builds Mindustry from the latest source code. If you wish to build a specific release, make sure to add something like "#tag=v108" to the git repository in the sources array, or use one of the Mindustry packages by dmitmel.