如何将Java 9'--permit-illegal-access'标志传递给Webstart应用程序? [英] How to pass the Java 9 '--permit-illegal-access' flag to a Webstart application?

查看:93
本文介绍了如何将Java 9'--permit-illegal-access'标志传递给Webstart应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过将 - permit-illegal-access 标记传递给VM,我使用JRE build 9-ea + 163运行我的应用程序。现在我想用Java Webstart启动应用程序。第一次尝试

I got my application running with JRE build 9-ea+163 by passing the --permit-illegal-access flag to the VM. Now I want to start the app with Java Webstart. A first try with

javaws -J--permit-illegal-access <JNLP-Url>

不起作用。我得到相同的 InaccessibleObjectException 模块java.base没有打开java.util到未命名的模块,因为没有flag。

does not work. I get the same InaccessibleObjectException with module java.base does not "opens java.util" to unnamed module as without the flag.

添加< j2se java-vm-args = - permit-illegal-accessversion =9 */> ; 到JNLP没有帮助。

Adding <j2se java-vm-args="--permit-illegal-access" version="9*"/> to the JNLP does not help.

Webstart是否支持 - permit-illegal-access flag?

Does Webstart support the --permit-illegal-access flag?

我可以在JNLP文件中另外指定标志吗?

Can I furthermore specify the flag in the JNLP file?

Btw,with Java 9

Btw, with Java 9

javaws https://docs.oracle.com/javase/tutorialJWS/samples/deployment/NotepadJWSProject/Notepad.jnlp

抛出 IllegalAccessException -J - permit-illegal-access 也没有帮助。

PS:设置env变量 JAVA_TOOL_OPTIONS - permit-illegal-access 有效,但由于无法访问客户端,因此不是解决方案。

P.S.: Setting the env variable JAVA_TOOL_OPTIONS to --permit-illegal-access works, but is not a solution since the clients are not accessible.

推荐答案

Java We b Start不支持 - permit-illegal-access 选项。需要打破封装的JNLP应用程序应该使用精确的选项,支持 - add-exports - add-opens

Java Web Start does not support the --permit-illegal-access option. JNLP apps that need to break encapsulation should use the precise options, there is support for both --add-exports and --add-opens.

这篇关于如何将Java 9'--permit-illegal-access'标志传递给Webstart应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆