Jenkins claims that "This execution happens in the agent JVM", but when I use this script on script console, I see the next result:
def proc = 'java -version'.execute()
def sout = new StringBuilder(), serr = new StringBuilder()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(10000)
println "out> $sout"
println "err> $serr"
java version "1.7.0"
Then I connect to the same agent via putty, use java -version
on conlose and get openjdk version "1.8.0_272"
Why?