评论者:sonicsmooth
感谢您提交这个补丁。静态初始化器的问题使得同时使用AOT和交互式开发进行JavaFX开发变得困难。我今天克隆了Clojure 1.9.0-master源代码,并应用了补丁,但示例Clojure项目仍然显示“正在运行静态初始化器!”。我验证了这是我的实际用例。如果先启动JFXPanel,错误就会消失。截至2017年9月,有其他解决方案吗?例如使用代理或在运行时定义?谢谢。
$ lein clean;lein repl
编译1个源文件到C:\dev\clojure\clojure-static-initialization\target\classes
编译clojure-static-initialization.gen-class-demo
编译clojure-static-initialization.proxy-demo
运行静态初始化器!
Clojure 1.9.0-master-SNAPSHOT
user=> (def lcp (proxy (link: javafx.scene.control.ListCell) (link: )))
编译器异常Java.lang.ExceptionInInitializerError,编译:(C:\dev\clojure\clojure-static-initialization\target\f31ee90298a1be447b450330204c3c0806c08b96-init.clj:1:10)
$ lein clean;lein repl
编译1个源文件到C:\dev\clojure\clojure-static-initialization\target\classes
编译clojure-static-initialization.gen-class-demo
编译clojure-static-initialization.proxy-demo
运行静态初始化器!
Clojure 1.9.0-master-SNAPSHOT
user=> (def jfxpanel (javafx.embed.swing.JFXPanel.))
'user/jfxpanel
user=> (def lcp (proxy (link: javafx.scene.control.ListCell) (link: )))
'user/lcp