# Help setting up a BTA! modding environment

**URL:** https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520
**Category:** Help
**Created:** [October 11, 2026, 1:55pm UTC](https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520 "2026-10-11T13:55:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gobbe](https://discourse.nixos.org/user_avatar/discourse.nixos.org/gobbe/32/35115_2.png) [@gobbe](https://discourse.nixos.org/u/gobbe)
#### Post date: [October 11, 2026, 1:55pm UTC](https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520/1 "2026-10-11T13:55:00Z")

</div>

getting this error:

```auto
Unpacked JDK archive does not contain a Java home: /home/gobbe/.gradle/.tmp/jdks/OpenJDK21U-jdk_x64_linux_hotspot_21-Eclipse-Temurin-2111441753919758025703.tmp

```

Installing Java through Home Manager, but unsure if JAVA\_HOME is properly set

```nix
programs.java = {
    enable = true;
    package = pkgs.jdk17;
# it says it sets home.sessionVariables.JAVA_HOME = "${cfg.package.home}";
# but unsure if IDEA/gradle finds this $JAVA_HOME
 };

```

installing IDEA with:

```bash
export NIXPKGS_ALLOW_UNFREE=1
nix-shell -p jetbrains.idea

```

tried using the BTA! mod template on codeberg ( [gobbe/bta-test: det rullar nu? - Codeberg.org](https://codeberg.org/gobbe/bta-test) ) and github ( [GitHub - Turnip-Labs/bta-example-mod: Fabric example mod for BTA · GitHub](http://github.com/Turnip-Labs/bta-example-mod) ), talked to the devs and they say they’ve never seen an error like this before. Both these examples work on a windows machine. Both produce the same error on NixOS

In other words, I opened IDEA, cloned either repo A or B. Waited for imports, then restarted IDEA. Error.

wondering what dependancies I should tweak or env-vars I should add to let gradle see java home

\*could also be that gradle atm is doing auto-install of java, and that java doesn’t have a proper nixos $JAVA\_HOME - if so I wonder how to set gradle up to use a current install of java.

Either way have struggled with this awhile and heard others also have had this issue so wondering if there are any solutions 🙂

---

<div class="post-metadata">

### Author: ![QuBe](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/q/ea666f/32.png) [@QuBe](https://discourse.nixos.org/u/QuBe)
#### Post date: [October 12, 2026, 8:39am UTC](https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520/2 "2026-10-12T08:39:11Z")

</div>

Not sure if I will be able to help, but have you tried `echo $JAVA_HOME` ?

And what happens on a hello-world java project ?

Also it’s not very clear how you reach this error, and were it comes from  
Could you give the steps in chronological order ?

And “BTA!” is the mod “Better Than Adventure” for minecraft, right ?

---

<div class="post-metadata">

### Author: ![gobbe](https://discourse.nixos.org/user_avatar/discourse.nixos.org/gobbe/32/35115_2.png) [@gobbe](https://discourse.nixos.org/u/gobbe)
#### Post date: [October 12, 2026, 5:52pm UTC](https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520/3 "2026-10-12T17:52:50Z")

</div>

Yes, sorry for being unclear with BTA! I am reffering to Better than adventure :³

running echo $JAVA\_HOME returns nothing atm /:

At the moment the steps I took to get this error where

1. Install Java (17) through home manager
2. Install jetbrains.idea with a nix-shell
3. Clone the example repo
4. Open it with IDEA and let it load
5. Restart IDEA

Then error

---

<div class="post-metadata">

### Author: ![QuBe](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/q/ea666f/32.png) [@QuBe](https://discourse.nixos.org/u/QuBe)
#### Post date: [October 12, 2026, 6:58pm UTC](https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520/4 "2026-10-12T18:58:05Z")

</div>

So:

1. Where is the error printed ?
2. It works perfectly fine the first time ?

If I were you I would now look into what `JAVA_HOME` is, and what `home.sessionVariables.JAVA_HOME` (if you don’t already)  
As I personnally do not, I can’t help you on this front

---

<div class="post-metadata">

### Author: ![QuBe](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/q/ea666f/32.png) [@QuBe](https://discourse.nixos.org/u/QuBe)
#### Post date: [October 12, 2026, 6:59pm UTC](https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520/5 "2026-10-12T18:59:02Z")

</div>

Oh and also the original error does not point at the nix store, could you check if it’s a symlink to it ?

---

<div class="post-metadata">

### Author: ![BENDI](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/b/4da419/32.png) [@BENDI](https://discourse.nixos.org/u/BENDI)
#### Post date: [October 12, 2026, 7:48pm UTC](https://discourse.nixos.org/t/help-setting-up-a-bta-modding-environment/80520/6 "2026-10-12T19:48:52Z")

</div>

When I wanted to do some MC dev work, I used a devshell, that worked.

There might be some things you don’t need in there, so some experimentation might be required on your part.

The main takeaway is that you can tell gradle where the JDKs it needs are at with these lines in your `gradle.properties`

```javaprop
org.gradle.java.installations.auto-download=false
org.gradle.java.installations.fromEnv=JDK8,JDK17,JDK21,JDK25

```

which is documented [here](https://docs.gradle.org/current/userguide/build_environment.html#:~:text=org%2Egradle%2Ejava%2Einstallations%2EfromEnv).

The reason I specifically have the Zulu JDK in there is because I was working with GTNH RFB, which aggressively wanted to download its own jdk and was only content with Zulu (I did not and still do not know enough to disable foojay-resolver or whatever it is called).

See my flake attached, maybe it helps you. I used direnv and launched intellij from the shell, but entering the shell with `nix shell` or using the direnv intellij plugin might also work, YMMV.

> **Nix flake**
>
> ```nix
> {
> description = "mc intellij flake";
> 
> inputs = {
> nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst";
> };
> 
> outputs =
> { self, nixpkgs, ... }@inputs:
> let
> system = "x86_64-linux";
> pkgs = nixpkgs.legacyPackages.${system};
> in
> {
> devShells.${system}.default = pkgs.mkShell {
> packages = with pkgs; [
> zulu25
> zulu21
> zulu17
> zulu8
> gradle_9
> jetbrains.idea-oss
> xrandr
> ];
> shellHook = "echo 'happy hacking'";
> JDK8 = "${pkgs.zulu8}";
> JDK17 = "${pkgs.zulu17}";
> JDK25 = "${pkgs.zulu25}";
> JDK21 = "${pkgs.zulu21}";
> JDKJB = "${pkgs.jetbrains.jdk-no-jcef}";
> LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (
> with pkgs;
> [
> glfw3-minecraft
> libGL
> libX11
> libXcursor
> libXext
> libXrandr
> libXxf86vm
> libjack2
> libpulseaudio
> libusb1
> openal
> xrandr
> ]
> );
> };
> 
> };
> }
> 
> ```
