w***y 发帖数: 6251 | |
m******t 发帖数: 2416 | 2
There is System.getEnv(), but it's deprecated since 1.2 - now in the new 5.0
it's been de-deprecated again. 8-)
【在 w***y 的大作中提到】 : 譬如得到一个环境变量SLIF? : thx
|
c*****s 发帖数: 214 | 3 不好整。getenv会抛出异常的。
还是启动程序时用 -D去传吧。
【在 w***y 的大作中提到】 : 譬如得到一个环境变量SLIF? : thx
|
xt 发帖数: 17532 | 4
Oh? That's better. I hate the fact that java cannot read environmental
variables.
【在 m******t 的大作中提到】 : : There is System.getEnv(), but it's deprecated since 1.2 - now in the new 5.0 : it's been de-deprecated again. 8-)
|
m******t 发帖数: 2416 | 5
5.0
Well, I guess they took it out before because env variables are hardly
platform neutral, then eventually they realized everybody has to write a shell
script to convert the env variables to properties in order to start a java
program, and then shell scripts are kinda hard to be platform neutral
anyway...
【在 xt 的大作中提到】 : : Oh? That's better. I hate the fact that java cannot read environmental : variables.
|
h**j 发帖数: 2033 | 6 System.getProperty("SLIF")
【在 w***y 的大作中提到】 : 譬如得到一个环境变量SLIF? : thx
|