使用netbeans时Ubuntu上的Javafx错误 [英] Javafx error on Ubuntu while using netbeans

查看:137
本文介绍了使用netbeans时Ubuntu上的Javafx错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试在ubuntu linux上运行基本的javafx应用程序时,我看到以下错误。使用命令行或netbeans运行应用程序时出现错误。

When trying to run a basic javafx application on ubuntu linux, I am seeing the following error. The error appears while using either the commandline or netbeans to run the application.

Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: /home/venkat/.m2/repository/com/oracle/javafx/javafx/2.1.0-beta/i386/libglass.so
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:277)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:90)
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:722)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /home/venkat/.m2/repository/com/oracle/javafx/javafx/2.1.0-beta/i386/libglass.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1828)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:143)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:56)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)
at com.sun.glass.ui.Application$1.run(Application.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:85)
at com.sun.glass.ui.gtk.GtkPlatformFactory.<clinit>(GtkPlatformFactory.java:23)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:20)
at com.sun.glass.ui.Application.Run(Application.java:108)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:267)
... 5 more


解决方案

导致此异常是因为maven无法在类路径中找到本机库。

This exception is caused because maven is unable to find the native libraries on the classpath.

Netbeans

您可以通过在运行中添加JVM参数来解决问题个人资料。

You can solve the problem by adding JVM argument inside the run profile.

-Djava.library.path = / home / venkat / Programs / javafx / 2.1.0-beta / rt / lib / i386 /

图像

命令行

如果您在尝试在命令行上运行应用时遇到同样的问题,则以下导出应修复它。

If you face the same problem while trying to run the app on the commandline, the following exports should fix it.

export JAVAFX_HOME=/home/venkat/Programs/javafx/2.1.0-beta

export CLASSPATH=\$JAVAFX_HOME/rt/lib/jfxrt.jar

export LD_LIBRARY_PATH=/home/venkat/Programs/javafx/2.1.0-beta/rt/lib/i386/

上面的前两个env变量修复了无法找到javafx运行时时出现的类路径问题。

The first two env variables above fix a classpath problem which is seen when javafx runtime cannot be found.

这篇关于使用netbeans时Ubuntu上的Javafx错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆