Reputation: 191
I would like to set -noverify as a VM argument through java code. 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?
I have tried using System.property("Xverify","none")
but this doesn't seem to work.
Note: This is just to run some test cases. I am turning off byte code verification because of this issue - link
Thank you.
Upvotes: 0
Views: 6195
Reputation: 98640
Let me summarize comments in this answer.
VerifyError
. This means that the application generates invalid bytecode, and when JVM executes it, the results are unpredictable. For example, JVM may crash like in this question.Upvotes: 9
Reputation: 1664
You need to use "-Xverify:none" as vm argument. It is recommended not to use -Xverify:none in production environment.
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. You can (but shouldn't) disable this protection on many JVMs by adding -Xverify:none
Please find the complete details about the side affect of using this flag - https://blogs.oracle.com/buck/entry/never_disable_bytecode_verification_in
Upvotes: 4