简体   繁体   English

如果在JVM上设置了-noverify,是否可以通过编程方式进行检查?

[英]Is there any way to programmatically check, if `-noverify` is set on the JVM?

I need to run some Tests with the VM-option -noverify . 我需要使用VM-option -noverify运行一些测试。
Now I would like to warn any other developer in this project to set this option, if not already done. 现在,我要警告该项目中的其他任何开发人员设置此选项(如果尚未完成)。

Another possible solution would be, of course, to set this option instead of just warn about it. 当然,另一种可能的解决方案是设置此选项,而不只是警告它。

The java.lang.System.getProperties() method determines the current system properties. java.lang.System.getProperties()方法确定当前的系统属性。 The current set of system properties for use by the getProperty(String) method is returned as a Properties object. 由getProperty(String)方法使用的当前系统属性集作为Properties对象返回。

Run this program 运行这个程序

public class ShowSystemProps {

   public static void main(String[] args) {

   // Get the current system properties
   Properties p = System.getProperties();
   p.list(System.out);
  }
} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM