简体   繁体   English

如何使用Eclipse摆脱javafx应用程序中的此错误?

[英]how do i get rid of this error in javafx application using eclipse?

I started learning javaFX a few days back and i was making simple hello world! 几天前我开始学习javaFX,当时我正在制作一个简单的hello world! application in eclipse, i already set the library as shown in the tutorials but i am getting this error in eclipse console, i am unable to resolve it please help. eclipse中的应用程序,我已经按照教程中所示设置了库,但是我在eclipse控制台中遇到此错误,我无法解决它,请帮忙。

my code was 我的代码是

package javafx;

import javafx.application.Application;
import javafx.stage.Stage;

public class simple extends Application
{

    @Override
    public void start(Stage stage) throws Exception 
    {
        stage.show();
    }

    public static void main(String...args)
    {
        launch(args);
    }

}

this is the error shown in eclipse 这是日食中显示的错误

Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: com.sun.glass.ui.win.WinApplication._submitForLaterInvocation(Ljava/lang/Runnable;)V
    at com.sun.glass.ui.win.WinApplication._submitForLaterInvocation(Native Method)
    at com.sun.glass.ui.win.WinApplication.submitForLaterInvocation(WinApplication.java:215)
    at com.sun.glass.ui.InvokeLaterDispatcher.run(InvokeLaterDispatcher.java:101)

The javafxrt.jar you added does not match the version that your JDK has hence there's a mismatch between your java and native javafx libs. 您添加的javafxrt.jar与JDK的版本匹配,因此您的java和本机javafx库之间存在不匹配。

I would suggest you are not adding a library your own but use e(fx)clipse. 我建议您不要添加自己的库,而是使用e(fx)clipse。 See https://www.eclipse.org/efxclipse/index.html and http://efxclipse.bestsolution.at/install.html (you get an all-in-one build from there) 请参阅https://www.eclipse.org/efxclipse/index.htmlhttp://efxclipse.bestsolution.at/install.html (您可以从那里获得一个多合一的内部版本)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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