java获取JVM启动参数 System.getProperty取 -D后的key即可 public class Test { public static void main(String[] args){ System.out.println(System.getProperty("configurePath")); } }
转自:https://www.baeldung.com/java-system-get-property-vs-system-getenv 1. Introduction The package java.lang is automatically imported when in a Java application. This package contains many commonly used classes from NullPointerException to Object, Ma