如何修复使用Gradle时出现的“package com.sun.webkit不可见”编译错误?

huangapple 未分类评论42阅读模式
英文:

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 = [&#39;--add-exports=javafx.web/com.sun.webkit=ALL-UNNAMED&#39;]
}

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?

huangapple
  • 本文由 发表于 2020年4月5日 04:05:24
  • 转载请务必保留本文链接:https://java.coder-hub.com/61034088.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定