Adding details in the manifest of JVM used to run the build


(Paul Grove) #1

I know how to customise the manifest file but how do I get information about the JVM used to run the build and compile the code so I can add this to my manifest?


(Dan Stine) #2

We use the following:

org.gradle.util.Jvm.current()

which returns, for example:

1.7.0_01 (Oracle Corporation 21.1-b02)

(Paul Grove) #3

Thanks just what I needed.


(Luke Daley) #4

Be aware that the ‘Jvm’ class leaked into the public API unintentionally and has been deprecated and will be removed. There is no public replacement planned.

A more future proof way would be to use the System properties directly. See http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties()


(Paul Grove) #5

Even better System properties works fine