我想在Java6上使用WebView
和WebEngine
类JavaFX
,我能够做到这一点还是必须使用Java 7?
我将jfxrt.jar
添加到项目中,但它不起作用,它给出了以下错误:
Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: /home/mohammad/workspace/Search/WebContent/WEB-INF/lib/amd64/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:679)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /home/mohammad/workspace/Search/WebContent/WEB-INF/lib/amd64/libglass.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1649)
at java.lang.Runtime.load0(Runtime.java:787)
at java.lang.System.load(System.java:1022)
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:188)
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
答案 0 :(得分:3)
请参阅http://www.oracle.com/technetwork/java/javafx/overview/faq-1446554.html#3
JavaFX支持哪些平台?
JavaFX可用 Windows,Mac OS X和Linux;有关更多详细信息,请参阅JavaFX 认证系统配置。
从JavaFX 2.2和Java SE 7开始 更新6,JavaFX库作为Java SE的一部分安装;一个 Java SEX的独立版本将继续用于Java SE 6 用户(仅限Windows),直到Java SE 6在二月份达到使用寿命 2013。
由于Java 6是EOL,你运气不好。
答案 1 :(得分:2)
如果您正在为Windows构建,则可以从此链接下载JavaFX 2.2.21 for Java 6 http://www.oracle.com/technetwork/java/javase/downloads/javafxjdk6-1728173.html,并将库添加到项目依赖项中。