JavaFX not available/not working at runtime for NB modules
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从链接的 for_nb_classloading 路径中的复现项目以及 org-netbeans-libs-javafx 依赖项设置开始。调查当模块依赖项使用 provided scope 时,modules/ext 中的 JavaFX 库如何被暴露,并以 Toolkit not initialized 堆栈跟踪作为失败点。完成的标准是模块能够使用文档中说明的依赖项设置运行 JavaFX,或者所需的用法已得到明确记录。
由索引模型根据 Issue 内容生成。
描述
Apache NetBeans version
Apache NetBeans 30
What happened
Goal: build a NB module which uses JavaFX for the UI.
Understood solution:
- add a dependency to org-netbeans-libs-javafx in the module pom
- add the needed dependencies for JavaFX modules (controls, fxml, etc.) in the module pom with scope
provided- NB should provide the classes - build the module
- install JavaFX Library for XXX (Linux/Windows/Mac)
- install the module
What works:
The module compile and installs, but when it tries to run JavaFX, it runs into exception
SEVERE [global]
java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:436)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:431)
at javafx.application.Platform.runLater(Platform.java:168)
at ste.netbeans.restart.RestartIDEAction.lambda$actionPerformed$2(RestartIDEAction.java:83)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
[catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
I would expect the module to pick the libraries in ext, which are available:
[ste userdir] =)o ls -la modules/ext/
total 54204
drwxrwxr-x 2 ste ste 4096 Jul 7 23:14 .
drwxrwxr-x 3 ste ste 4096 Jul 7 23:15 ..
-rw-rw-r-- 1 ste ste 753864 Jul 7 23:14 javafx-base-21.0.9-linux.jar
-rw-rw-r-- 1 ste ste 2585211 Jul 7 23:14 javafx-controls-21.0.9-linux.jar
-rw-rw-r-- 1 ste ste 4697444 Jul 7 23:14 javafx-graphics-21.0.9-linux.jar
-rw-rw-r-- 1 ste ste 1507586 Jul 7 23:14 javafx-media-21.0.9-linux.jar
-rw-rw-r-- 1 ste ste 89705 Jul 7 23:14 javafx-swing-21.0.9-linux.jar
-rw-rw-r-- 1 ste ste 45844181 Jul 7 23:14 javafx-web-21.0.9-linux.jar
It seems instead these libraries are not available unless declared as compile scope.
Language / Project Type / NetBeans Component
No response
How to reproduce
See https://github.com/stefanofornari/nb-ide-restart/tree/ste/test/for_nb_classloading
Did this work correctly in an earlier version?
No / Don't know
Operating System
Linux
JDK
both OpenJDK 21 and Zulu 21.50
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
I could not find any useful and updated documentation at least on how JavaFX IMplementation for XXX is supposed to work and how to use it either to build a JavaFX application or a module using JavaFX
Are you willing to submit a pull request?
No
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 939
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 40
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/netbeans 的其他 Issue
-
Contribution welcome kind:feature Platform
难度 2/5 1-3 小时 新手友好度 72/100
apache/netbeans#9614 · 2 条评论 ·
维护者通常 1 天内回复
-
kind:bug LSP needs:triage
难度 2/5 1-3 小时 新手友好度 78/100
apache/netbeans#9548 · 1 条评论 ·
维护者通常 1 天内回复
-
Editor Java kind:feature needs:triage
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
kind:bug needs:triage os:linux os:macos Platform UI
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
kind:bug needs:triage
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
相似的 Issue
-
[Bug] dubbo.protocol.triple.max-message-size is only read from OS environment variables可能已有人在做 @CCCLL 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
hierynomus/sshj#1070 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
intellij-elixir/intellij-elixir#4492 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
quarkiverse/quarkus-openapi-generator#1796 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 66/100
quarkiverse/quarkus-jooq#324 ·
维护者通常 1 天内回复