我遵循了在这个链接中找到的建议,能够让javafx在linux上很好地与intellij配合使用。但是,尝试在windows 10上执行相同的操作(添加javafx sdk,设置虚拟机选项)会在运行默认hello world程序时导致以下错误:
"C:\Program Files\Java\jdk-11.0.1\bin\java.exe" \
--module-path C:/Users/user01/Downloads/openjfx-11.0.2_windows-x64_bin-sdk/lib \
--add-modules=javafx.controls \
--add-modules javafx.base,javafx.graphics \
--add-reads javafx.base=ALL-UNNAMED \
--add-reads javafx.graphics=ALL-UNNAMED \
"-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.3\lib\idea_rt.jar=55783:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.3\bin" \
-Dfile.encoding=UTF-8 \
-classpath C:\Users\user01\Source\Repos\CalendarToDO\out\production\CalendarToDO;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\src.zip;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx-swt.jar;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx.web.jar;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx.base.jar;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx.fxml.jar;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx.media.jar;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx.swing.jar;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx.controls.jar;C:\Users\user01\Downloads\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib\javafx.graphics.jar \
sample.Main
Error occurred during initialization of boot layer: java.lang.module.FindException: \
Module javafx.base not found
Process finished with exit code 1
这很奇怪,因为我可以扩展添加的lib并查看javafx.base的.jar:
任何帮助或经验,别人将不胜感激!
暂无答案!
目前还没有任何答案,快来回答吧!