0

我们如何从 Java 代码中获取以下详细信息?特别是 SR 和 FP 细节。

java version "1.7.0"
Java(TM) SE Runtime Environment (build pap6470_27sr1fp1-20140708_01(SR1 FP1))
IBM J9 VM (build 2.7, JRE 1.7.0 AIX ppc64-64 Compressed References
20140707_205525 (JIT enabled, AOT enabled)
J9VM - R27_Java727_SR1_20140707_1408_B205525
JIT  - tr.r13.java_20140410_61421.07
GC   - R27_Java727_SR1_20140707_1408_B205525_CMPRSS
J9CL - 20140707_205525)
JCL - 20140707_01 based on Oracle 7u65-b16
4

1 回答 1

1

That information is put together from the System properties. To find the appropriate set of properties, run java -XshowSettings:properties.

In this case, the property you want is the java.runtime.version which has a value like: pxi3270_27sr4-20160303_03 (SR4). You can parse the SR / FP out of the brackets. If there isn't one, then it's the GA level.

于 2016-03-08T16:16:59.667 回答