-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Debugger fails to start #191
Comments
Hi! Thanks for reporting the issue. Are both projects running with the same JVM? Can you share more details about your JVM, like Can you also add here the |
No, the one which doesn't work is within a nix environment, so the jvm and everything else is separate. Working:
Not working (within nix):
The path has too much info about the companies behind the projects :( |
No problem! So I guess the issue isn't related to your projects nor the classpath nor flow-storm, but to the JVM and native libraries on that nix environment. Here is a very small Clojure JavaFX project you can try to run in that Nix environment, it should also fail : deps.edn {:deps {org.openjfx/javafx-controls {:mvn/version "21.0.4-ea+1"}
org.openjfx/javafx-base {:mvn/version "21.0.4-ea+1"}
org.openjfx/javafx-graphics {:mvn/version "21.0.4-ea+1"}}} src/main.clj (ns main
(:import [javafx.application Platform]
[javafx.scene Scene]
[javafx.stage Stage]
[javafx.scene.control Label]))
(defn -main []
(Platform/startup (fn [] (println "JavaFX toolkit initialized")))
(Platform/runLater
(fn []
(let [scene (Scene. (Label. "Hello world") 1024 768)
stage (doto (Stage.)
(.setScene scene))]
(.show stage)))))
Which you can run with It seams there have been similar issues reported on Nix NixOS/nixpkgs#220470 and some hacks to solve them. Looks like On my Debian I have it here I would try to make sure that lib is installed and on the LD_LIBRARY_PATH |
Thank you! I'll try it out and report 🙏 |
Tried it, here's the result: {:clojure.main/message
"Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader/loadLibrary (ClassLoader.java:2458).\nno glassgtk3 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib\n",
:clojure.main/triage
{:clojure.error/class java.lang.UnsatisfiedLinkError,
:clojure.error/line 2458,
:clojure.error/cause
"no glassgtk3 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib",
:clojure.error/symbol java.lang.ClassLoader/loadLibrary,
:clojure.error/source "ClassLoader.java",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.lang.RuntimeException,
:message
"java.lang.UnsatisfiedLinkError: no glassgtk3 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib",
:at
[com.sun.javafx.tk.quantum.QuantumToolkit
startup
"QuantumToolkit.java"
300]}
{:type java.lang.UnsatisfiedLinkError,
:message
"no glassgtk3 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib",
:at [java.lang.ClassLoader loadLibrary "ClassLoader.java" 2458]}],
:trace
[[java.lang.ClassLoader loadLibrary "ClassLoader.java" 2458]
[java.lang.Runtime loadLibrary0 "Runtime.java" 916]
[java.lang.System loadLibrary "System.java" 2059]
[com.sun.glass.utils.NativeLibLoader
loadLibraryInternal
"NativeLibLoader.java"
170]
[com.sun.glass.utils.NativeLibLoader
loadLibrary
"NativeLibLoader.java"
58]
[com.sun.glass.ui.gtk.GtkApplication
lambda$new$5
"GtkApplication.java"
173]
[java.security.AccessController
doPrivileged
"AccessController.java"
319]
[com.sun.glass.ui.gtk.GtkApplication
<init>
"GtkApplication.java"
162]
[com.sun.glass.ui.gtk.GtkPlatformFactory
createApplication
"GtkPlatformFactory.java"
40]
[com.sun.glass.ui.Application run "Application.java" 146]
[com.sun.javafx.tk.quantum.QuantumToolkit
startup
"QuantumToolkit.java"
290]
[com.sun.javafx.application.PlatformImpl
startup
"PlatformImpl.java"
292]
[javafx.application.Platform startup "Platform.java" 113]
[main$_main invokeStatic "main.clj" 8]
[main$_main invoke "main.clj" 7]
[clojure.lang.AFn applyToHelper "AFn.java" 152]
[clojure.lang.AFn applyTo "AFn.java" 144]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause
"no glassgtk3 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib"}} |
Yeah, so it isn't related to FlowStorm, it can't run any javafx program because it can't find gassgtk3. It says it is searching in In my Debian system it is here You can maybe try to search for that library file (libglassgtk3.so) and if it is there somewhere, try run the little project like with this deps.edn : {:deps {org.openjfx/javafx-controls {:mvn/version "21.0.4-ea+1"}
org.openjfx/javafx-base {:mvn/version "21.0.4-ea+1"}
org.openjfx/javafx-graphics {:mvn/version "21.0.4-ea+1"}}
:aliases {:javafx {:jvm-opts ["-Djava.library.path=/usr/.../glass-folder/"]}}} Then you can run with But all this is quite hacky, there is probably a better way of running javafx application in Nix. |
I found on the JavaFX sources how it looks for these libraries https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java#L113-L123 |
I don't know of a clean way to solve this issue, but what you can do is basically set {
description = "example flake for openjfx compatibility";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { pkgs, config, ... }:
let
libraries = with pkgs; [
at-spi2-atk
cairo
gdk-pixbuf
glib
gtk3
pango
xorg.libXtst
libGL
xorg.libX11
xorg.libXxf86vm
];
libraryPath = pkgs.lib.makeLibraryPath libraries;
in {
devShells.default = pkgs.mkShell {
buildInputs = libraries;
shellHook = ''
export LD_LIBRARY_PATH=${libraryPath}:$LD_LIBRARY_PATH
'';
};
};
};
} just run |
This happens in a larger of my projects (works fine on the same machine on a smaller project). It fails to launch both in vanilla and full-fledged mode. Trace:
alias:
Any advice on how to solve this?
The text was updated successfully, but these errors were encountered: