How to avoid adding vm arguments everytime I create a new javafx project?

非 Y 不嫁゛ 提交于 2021-01-24 08:13:02

问题


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

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

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

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

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/62689802/how-to-avoid-adding-vm-arguments-everytime-i-create-a-new-javafx-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!