我正在使用JavaFX 2的某些功能(例如WebBrowser)开发Java Swing应用程序。
我试图从我的文件夹中引用jfxrt.jar文件,因为看起来MAC的javaFX2安装程序不可用(仅安装Java 7)。 但我想将JavaFX 2与Java 6一起使用。
我收到此错误:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.lang.NoSuchMethodError: getScaleFactor
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(Unknown Source)
at com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.embed.swing.JFXPanel.initFx(Unknown Source)
at javafx.embed.swing.JFXPanel.<init>(Unknown Source)
at javabrowser.JpJavaBrowser.initComponentsFx(JpJavaBrowser.java:63)
at javabrowser.JpJavaBrowser.<init>(JpJavaBrowser.java:59)
at orderbook.FrOrderBook.initComponents(FrOrderBook.java:625)
at orderbook.FrOrderBook.<init>(FrOrderBook.java:179)
at orderbook.FrOrderBook$2.run(FrOrderBook.java:681)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
...
Caused by: java.lang.NoSuchMethodError: getScaleFactor
at com.sun.glass.ui.mac.MacApplication._initIDs(Native Method)
at com.sun.glass.ui.mac.MacApplication.<clinit>(Unknown Source)
at com.sun.glass.ui.mac.MacPlatformFactory.createApplication(Unknown Source)
at com.sun.glass.ui.Application.Run(Unknown Source)
... 23 more
我该如何解决这个问题?
答案 0 :(得分:1)
JavaFX 2在OS-X上不支持Java6 - 仅在win32上支持Java6