-
Notifications
You must be signed in to change notification settings - Fork 58
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
How to specify the Java version? #11
Comments
When calling A more ergonomic way to do this would be to have a |
I got it to work now, thanks. Feel free to close this issue if you don't think adding |
It's probably worth documenting this; it took me a few tries to get a working override here. Here's what I ended up with which worked for my derivation (where I needed to build with jdk11 but it was defaulting to jdk8): { callPackage, gradleGen, pkgs, ... }:
let
buildGradle = callPackage ./gradle-env.nix {
gradleGen = gradleGen.override {
java = pkgs.jdk11;
};
};
in
buildGradle {
envSpec = ./gradle-env.json;
src = ./myProjectSrc;
# ... etc
} I'm curious if that's the same solution you ended up with, or a different one @piegamesde |
I went with an overlay: let
nixpkgs = import <nixpkgs> {
overlays = [(self: super: {jdk = super.jdk12;} )];
};
buildGradle = nixpkgs.callPackage ./gradle-env.nix {};
in
buildGradle {
} |
I think the two easiest paths to resolving this issue are:
@tadfisher Do you have any opinion or other ideas here? I think 1 makes sense to me and I'm happy to open a PR if you'd like. |
I nixified my JavaFX application and when trying to build it I get
java.lang.UnsupportedClassVersionError: org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
.Using Gradle, everything runs fine, I also set the compatibility to
JavaVersion.VERSION_11
which is version 55.The text was updated successfully, but these errors were encountered: