Eclipse自定义系统属性 ——JVM参数

Eclipse调试时,JVM参数的录入,例如:-D

这几天在看Cassandra的源代码,Cassandra是通过org.apache.cassandra.service.CassandraDaemon来启动的。在-D的参数中(storage-config)指定了的Cassandra配置文件storage-conf.xml的路径。系统通过下面的code来获取值:

Java代码  
  1. configFileName_ = System.getProperty("storage-config") + File.separator + "storage-conf.xml";  

而我在eclipse中直接运行CassandraDaemon时,怎么来设置storage-config参数呢?请看下图:



 在VM arguments:中直接录入-Dstorage-config=bin\\conf就可以了。如果是下面的code

Java代码  
  1. System.getenv("storage-config")  

则需要在Environment Tab项中设置。

 public static final String EXIF_TOOL_PATH = System.getProperty(   "exiftool.path", "exiftool");

转载自:http://swingboat.iteye.com/blog/518303

原文地址:https://www.cnblogs.com/wuhenke/p/2257115.html