错误:缺少JavaFX运行时组件,并且在Eclipse中运行该应用程序是必需的 [英] Error: JavaFX runtime components are missing, and are required to run this application in eclipse

查看:1405
本文介绍了错误:缺少JavaFX运行时组件,并且在Eclipse中运行该应用程序是必需的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JavaFX的初学者,并试图在Ubuntu上的Eclipse中运行JavaFX。

I am a beginner in JavaFX and trying to run JavaFX in Eclipse on Ubuntu.

我在PC上安装了openjfx,但是它给出了错误消息

I have openjfx installed on my pc, but it is giving the error


缺少JavaFX运行时组件,这些组件是运行此应用程序所必需的。

JavaFX runtime components are missing, and are required to run this application.

我已经搜索了很多,但没有任何解决方案。

I have searched a lot but not got any solution.

推荐答案

尝试简单地创建启动器。

对于您的App,它应该看起来像这样:

Try simply creating a launcher.
For your App, it should look something like this:

package application;

import javafx.application.Application;

public class MainLaunch {

    public static void main(final String[] args) {
        Application.launch(Main.class, args);
    }
}

(您可以将旧的main方法保留在未使用的状态App for the time-being)

这对我来说与JDK 13& JavaFX 13和Eclipse 2019-12在Ubuntu下。

(我使用 new / Maven Project / Simple Project创建了Project,然后只是将JavaFX,Logging和其他内容作为依赖项添加到pom.xml中,所有这些都已登陆)

无需担心Java模块。



如果可行,您可以花一些时间改天再学习Java模块化...

(you can leave the old main Method unused in your App for the time-being)
This worked for me with JDK 13 & JavaFX 13 & Eclipse 2019-12 under Ubuntu.
(I created the Project using "new/Maven Project/Simple Project" and then just added JavaFX, Logging & other stuff as dependencies in pom.xml, which all landed on the Classpath. Only the JDK was on the Modulepath)
No need to bother about Java Modules.

If that works, you can take time to learn about Java Modularisation another day...

这篇关于错误:缺少JavaFX运行时组件,并且在Eclipse中运行该应用程序是必需的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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