如何避免每次创建新的javafx项目时都添加vm参数? [英] How to avoid adding vm arguments everytime I create a new javafx project?

查看:143
本文介绍了如何避免每次创建新的javafx项目时都添加vm参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用e(fx)clipse插件和SceneBuilder在STS(4.6.1)中创建javafx项目.

I am creating javafx projects in STS(4.6.1) with e(fx)clipse plugin and scenebuilder.

每次创建新项目时,都必须在运行配置中添加VM参数:

Everytime I create a new project, I have to add the VM arguments in run configurations:

--module-path "/home/path/to/javafx sdk/lib" --add-modules javafx.controls,javafx.fxml

否则程序会以错误消息结尾

otherwise the program ends with the error message which says

Error: Could not find or load main class application.Main
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

对于每个令人烦恼的javafx项目,我都必须这样做.

I have to do this for every javafx project which is irritating.

有没有办法一劳永逸地添加它?

Is there a way to add this once and for all?

谢谢

推荐答案

您可以在Eclipse中使用特定值创建自己的变量.当您需要此值时,可以通过创建一个Eclipse中的变量来存储VM参数.

You can create your own variable in Eclipse with the specific value. When you need this value you can then choose from the variables list and add it to VM arguments by creating a variable in Eclipse to store the VM arguments.

这篇关于如何避免每次创建新的javafx项目时都添加vm参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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