Hi,
I looked extensively and the standard solution found in SO or other places
doesn't work for me.. do you know what is the problem and how to fix it?
thanks for any help in advance!
a sample pipeline:
---
pipeline {
agent any
environment {
JAVA_INFO= ""
}
stages {
stage('test read info') {
steps {
script {
JAVA_INFO = sh(returnStdout: true, script: "java
-version")
sh("echo this is java: ${JAVA_INFO}")
}
}
}
}
}
-----------
EXPECTED OUTPUT:
this is java: openjdk version "11.0.4" 2019-07-16
... (more lines)
CURRENT OUTPUT: (echo is empty)
[Pipeline] sh+ java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Debian-1deb10u1, mixed mode,
sharing)[Pipeline] sh+ echo this is java:
this is java:[Pipeline] }[Pipeline] // script
Regards,
Pablo
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/383d7586-8a5c-4d57-82c3-56ba9ce71ece%40googlegroups.com.