简体   繁体   中英

Can we have some JavaFX classes in Java 6

I want to use WebView and WebEngine classes of JavaFX on Java6, am I able to do this or I must use Java 7? I add the jfxrt.jar to the project, but it doesn't work, it gives the error below:

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

See http://www.oracle.com/technetwork/java/javafx/overview/faq-1446554.html#3

What platforms are supported by JavaFX?

JavaFX is available on Windows, Mac OS X, and Linux; for more details, see the JavaFX Certified System Configurations.

As of JavaFX 2.2 and Java SE 7 update 6, the JavaFX libraries are installed as part of Java SE; a standalone version of JavaFX 2.2 will remain available for Java SE 6 users (Windows only) until Java SE 6 reaches End-of-Life in February 2013.

Since Java 6 is EOL, you are out of luck.

如果要针对Windows进行构建,则可以从此链接http://www.oracle.com/technetwork/java/javase/downloads/javafxjdk6-1728173.html下载JavaFX 2.2.21 for Java 6,并将该库添加到您的项目依赖性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM