在项目中指定环境变量,例如:
public class Main {
public static void main(String[] args) {
String customPath = System.getenv("CUSTOM_PATH"); // 获取环境变量CUSTOM_PATH的值
System.out.println("Custom path:" + customPath);
// ...
}
}
然后在项目配置中添加环境变量:
CUSTOM_PATH=/path/to/custom/directory
在使用Azul Zulu JDK 13.0.10时,应该能够正确获取环境变量的值。