Hello, I've created a new JavaFX 2 project with Eclipse Kepler on Windows XP. I've just selected "New > JavaFX project" and compiled it to an executable jar. It runs on my WinXP machine but fails on Linux or Mac.
This is the stack I get when trying to run it on Debian: what's going on?
Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: /home/user/Downloads/i386/libglass.so
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:281)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:124)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /home/user/Downloads/i386/libglass.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1842)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:200)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:88)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:80)
at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:28)
at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:25)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.gtk.GtkPlatformFactory.<clinit>(GtkPlatformFactory.java:25)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:20)
at com.sun.glass.ui.Application.Run(Application.java:103)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:271)
... 5 more
How did you produce the executable jar? Did you use the fxbuild support?
Tom
On 24.09.13 22:48, Kimi Kimi wrote:
> Hello, I've created a new JavaFX 2 project with Eclipse Kepler on
> Windows XP. I've just selected "New > JavaFX project" and compiled it to
> an executable jar. It runs on my WinXP machine but fails on Linux or Mac.
> This is the stack I get when trying to run it on Debian: what's going on?
>
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.UnsatisfiedLinkError: Can't load library:
> /home/user/Downloads/i386/libglass.so
> at
> com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:281)
> at
> com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:124)
> at
> com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)
>
> at
> com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
> at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
> at java.lang.Thread.run(Thread.java:724)
> Caused by: java.lang.UnsatisfiedLinkError: Can't load library:
> /home/user/Downloads/i386/libglass.so
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1842)
> at java.lang.Runtime.load0(Runtime.java:795)
> at java.lang.System.load(System.java:1061)
> at
> com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:200)
>
> at
> com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:88)
>
> at
> com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)
> at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73)
> at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:80)
> at
> com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:28)
> at
> com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:25)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.sun.glass.ui.gtk.GtkPlatformFactory.<clinit>(GtkPlatformFactory.java:25)
>
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:190)
> at
> com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:20)
>
> at com.sun.glass.ui.Application.Run(Application.java:103)
> at
> com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:271)
> ... 5 more
I actually compiled it with Eclipse "Export..." menu. I also tried compiling with build.fxbuild but I keep having this problem that I don't know how to fix
[taskdef] Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found.
.
.
.
BUILD FAILED
C:\Documents and Settings\...\build\build.xml:93: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:resources
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
1) Update to the last "JDK 7 update 40" (both Windows and Linux) and set "Java Build Path > Libraries > JRE System Library [jdk1.7.0_40]" in the project settings
2) Build using "build.fxbuild"
3) Export with Eclipse through "Export... > Runnable JAR file"