NixOS JVM | 119 Members | |
| 26 Servers |
| Sender | Message | Time |
|---|---|---|
| 4 Jul 2024 | ||
| 15:52:32 | ||
| 5 Jul 2024 | ||
| 13:26:42 | ||
| 6 Jul 2024 | ||
| 20:13:34 | ||
Hi! In NixOS, is there a way to install multiple JDKs next to each other, and have the "default" (providing the java command) selected by programs.java, but still be able to point some programs (like gradle) to another JDK? | 20:15:17 | |
| * Hi! In NixOS, is there a way to install multiple JDKs next to each other, and have the "default" (providing the I tried setting | 20:18:43 | |
| To my knowledge, there unfortunately isn't a system to do this across a system environment | 20:23:29 | |
| (Namely because you can only (really) have 1 copy of something in the path) | 20:24:25 | |
| Multiple Java versions on Linux in other distros is kinda an illusion, in that they are just switching which version is properly installed though things like apt's alternatives, then setting a different JAVA_HOME | 20:25:07 | |
| * Multiple Java versions on Linux in other distros is kinda an illusion, in that they are just switching which version is properly installed though things like apt's alternatives, then setting a different JAVA_HOME and PATH | 20:26:06 | |
| If you want to have a different version for gradle in a project-specific manner, setting up a devshell would likely be the best option | 20:26:39 | |
| Thanks! I just found https://github.com/NixOS/nixpkgs/pull/119444 and that seems to do the trick / work well enough for my specific use case. | 20:30:09 | |
| Neat, good to know | 20:31:10 | |
Hm, the build succeeded, but now I have a different issue: Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /home/[USER]/.openjfx/cache/21.0.1+6/amd64/libprism_es2.so: libXxf86vm.so.1: cannot open shared object file: No such file or directory.Any idea how to solve that? I guess if I could get it to use the NixOS OpenJFX... | 20:45:21 | |
Try adding xorg.libXxf86vm to your system packages | 20:48:27 | |
| Using the Nixpkgs OpenJFX would be the better solution | 20:48:38 | |
| 7 Jul 2024 | ||
I do not know much about OpenJFX. How can I make gradle run run the application with a different OpenJFX implementation? Does that need modifications to the build.gradle script? | 00:18:25 | |
| Unfortunately I don't know much about JFX either, so I'd have to do some tinkering to figure it out | 03:44:45 | |
| (And I have a midterm Monday so unfortunately I don't have the time to dig into it at the moment) | 03:45:11 | |
| Thanks! I found docs that seem promising: https://github.com/openjfx/javafx-gradle-plugin?tab=readme-ov-file#5-using-a-local-javafx-sdk However I noticed that after
Is this because I have no application installed that uses these packages? So Nix ignores | 14:20:04 | |
| How- How did matrix put that message in between July 6th messages | 14:20:55 | |
Download SmartSelect_20240707_102112_SchildiChat.jpg | 14:21:32 | |
Download SmartSelect_20240707_102122_SchildiChat.jpg | 14:21:33 | |
In reply to @devurandom:matrix.orgMore specifically, it gets garbage collected because it isn't listed as a garbage collection root. I believe there is a nix store command to add it manually, or you can use something like system.extraDependencies to include it in your NixOS configuration | 14:23:42 | |
| It's not an ideal solution, referring to nix store paths explicitly isn't generally recommended, but it does work at least | 14:24:31 | |
Thanks! Why did that not happen to other packages in systemPackages? Because they install sth into /run/current-system? | 14:25:12 | |
In reply to @devurandom:matrix.orgYes. Everything that is installed in the system is part of the "closure", which is marked as a garbage collection root, so it doesn't get cleaned up | 14:26:14 | |
| (It wouldn't be very good if you garbage collected all of the stuff your system needed to run lol) | 14:26:34 | |
| Sadly this does not work. The Gradle JavaFX plugin can take the path to the JavaFX SDK, but that SDK contains JARs and shared objects, while Maybe I have to write a Nix derivation to make this work? | 14:47:04 | |
| * Sadly this does not work. The Gradle JavaFX plugin can take the path to the JavaFX SDK, but that SDK contains JARs and shared objects, while Maybe I have to write a Nix derivation to make this work? | 14:55:13 | |
| * Sadly this does not work. The Gradle JavaFX plugin can take the path to the JavaFX SDK, but that SDK contains JARs and shared objects, while Maybe I have to write a Nix package to make this work? | 19:53:05 | |