diff --git a/README.md b/README.md index ee1a784..64f857f 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Check which Java toolchains can be found by Gradle: - `shell1.nix` -> works 🥳 - `shell2.nix` -> broken (as well for `gradle javaToolchains`) - `shell3.nix` -> works 🥳 +- `shell4.nix` -> works 🥳 This should include version >= 17, e.g.: @@ -40,13 +41,15 @@ Open issue: gradle's toolchain support does not work with IntelliJ - `shell2.nix` - Another approach - which did no longer work! https://github.com/utybo/Tegral/blob/main/shell.nix - `shell3.nix` - - This works 🥳 + - This works with JDK 21 🥳 - STRG ALT SHIFT s -> SDK -> add JDK -> - home path: /usr/lib/openjdk - name: usr-lib-jdk - STRG ALT s -> build tools -> gradle -> - local installation: /usr/lib/gradle - Gradle JVM: usr-lib-jdk +- `shell4.nix` + - This works with JDK23 🚀 ### Tasks diff --git a/app/build.gradle.kts b/app/build.gradle.kts index faa7dd0..71687b0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -28,7 +28,7 @@ dependencies { // Apply a specific Java toolchain to ease working on different environments. java { toolchain { - languageVersion = JavaLanguageVersion.of(22) + languageVersion = JavaLanguageVersion.of(23) } } diff --git a/shell4.nix b/shell4.nix new file mode 100644 index 0000000..6ab56fb --- /dev/null +++ b/shell4.nix @@ -0,0 +1,25 @@ +# https://discourse.nixos.org/t/how-to-create-a-development-environment-with-intellij-idea-and-openjdk/10153 +{ + pkgs ? import { + # https://github.com/NixOS/nixpkgs/issues/166220#issuecomment-1745803058 + config.allowUnfree = true; + } +}: + +let + unstable = import (fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz) { }; + jdk = unstable.jdk23; + gradle = unstable.gradle; +in + +( + pkgs.buildFHSUserEnv + { + name = "foo2"; + targetPkgs = pkgs_: [ + pkgs_.jetbrains.idea-ultimate + jdk + gradle + ]; + } +).env