赞
踩
在底层框架研发中, 框架启动脚本,在调用核心入口类之前需要先获取以及解析环境变量,然后解析到的环境变量可能想要在框架启动类中做info日志输出。
public class EnvTest {
public static void main(String[] args) {
System.out.println("获取到父进程的环境变量的值为:"+ System.getenv("test"));
}
}
#!/bin/bash
export test=/home/test
exec java -cp Flink1.8-1.0-SNAPSHOT.jar com.pg.EnvTest
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。