[英]Set -noverify flag in java code
I would like to set -noverify as a VM argument through java code. 我想通过Java代码将-noverify设置为VM参数。 I could not find any resource online to help with this.
我找不到在线任何资源来帮助解决此问题。
If I use System.setProperty(..,..)
, what do I set as the value or perhaps the key? 如果我使用
System.setProperty(..,..)
,该如何设置值或键?
I have tried using System.property("Xverify","none")
but this doesn't seem to work. 我尝试使用
System.property("Xverify","none")
但这似乎不起作用。
Note : This is just to run some test cases. 注意 :这只是为了运行一些测试用例。 I am turning off byte code verification because of this issue - link
由于这个问题,我正在关闭字节码验证- 链接
Thank you. 谢谢。
Let me summarize comments in this answer. 让我总结一下此答案中的评论。
VerifyError
. VerifyError
。 This means that the application generates invalid bytecode, and when JVM executes it, the results are unpredictable. You need to use "-Xverify:none" as vm argument. 您需要使用“ -Xverify:none”作为vm参数。 It is recommended not to use -Xverify:none in production environment.
建议在生产环境中不要使用-Xverify:none。
For those of you unfamiliar with bytecode verification, it is simply part of the JVM's classloading process that checks the code for certain dangerous and disallowed behavior. 对于不熟悉字节码验证的用户,这只是JVM的类加载过程的一部分,该过程检查代码是否存在某些危险和不允许的行为。 You can (but shouldn't) disable this protection on many JVMs by adding -Xverify:none
您可以(但不应)通过添加-Xverify:none来在许多JVM上禁用此保护。
Please find the complete details about the side affect of using this flag - https://blogs.oracle.com/buck/entry/never_disable_bytecode_verification_in 请找到有关使用此标志的副作用的完整详细信息-https: //blogs.oracle.com/buck/entry/never_disable_bytecode_verification_in
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.