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

Document how to change java package #64

Open
darichey opened this issue May 26, 2024 · 1 comment
Open

Document how to change java package #64

darichey opened this issue May 26, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request package Topic: Deals with nix-minecraft packages

Comments

@darichey
Copy link

Minecraft 1.20.5+ requires Java 21, but jre_headless in nixpkgs 23.11 is Java 19. This causes the server to fail to start with an error like

net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 63.0

This can be fixed by overriding the jre_headless input to the desired server package like

package = pkgs.fabricServers.fabric-1_20_6.override {
  jre_headless = pkgs.temurin-jre-bin-21;
};

Maybe this could be made more convenient with some kind of javaPackage option? Either way, it would be great to document a recommended approach.

I see that you probably already noticed some related issue here with d9ca459.

@Infinidoge
Copy link
Owner

Infinidoge commented May 27, 2024

Yeah, I did notice this issue, which ended up being """fixed""" by me bumping the nixpkgs revision both for nix-minecraft and in my system configuration. Ideally this should be fixed by requesting the proper version in nix-minecraft explicitly, as opposed to setting it. (I.e., nix-minecraft will explicitly gran jdk 8/17/21 instead of 8 or 'latest')

I do agree that this should be documented though, especially in the event that someone wants to use a custom version of Java for whatever reason.

Making the input javaPackage ? jre_headless (this you use .override { javaPackage = ...; } instead) would be small but nice.

@Infinidoge Infinidoge added documentation Improvements or additions to documentation enhancement New feature or request package Topic: Deals with nix-minecraft packages labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request package Topic: Deals with nix-minecraft packages
Projects
None yet
Development

No branches or pull requests

2 participants