英文:
How to fix "package com.sun.webkit is not visible" combile error using Gradle?
问题
我想在Java 10中使用`comb.sun.webkit`包,但是在编译时一直出现错误:
package com.sun.webkit不可见(包com.sun.webkit在模块javafx.web中声明,但未导出)
我尝试通过修改Gradle脚本来修复它:
```gradle
run {
jvmArgs = ['--add-exports=javafx.web/com.sun.webkit=ALL-UNNAMED']
}
据我所知,我们没有使用模块(项目中没有module-info.java
),所以应该可以正常工作。然而,即使指定了jvmArgs
,我仍然得到相同的错误。
我做错了什么?
<details>
<summary>英文:</summary>
I want to use `comb.sun.webkit` package in Java 10, but I keep getting the error at compilation:
package com.sun.webkit is not visible(package com.sun.webkit is declared in module javafx.web, which does not export it)
I tried to fix it by modifying the gradle script:
```gradle
run {
jvmArgs = ['--add-exports=javafx.web/com.sun.webkit=ALL-UNNAMED']
}
To my knowledge we are not using modules (no module-info.java
in the project) so it should work. Yet, I still get the same error even with the jvmArgs
specified.
What am I doing wrong?
专注分享java语言的经验与见解,让所有开发者获益!
评论