Get Jenkins version via java -jar jenkins.war --version without spam output
<p>I'm trying to get the version of the Jenkins war deployed to <code>/usr/share/jenkins/jenkins.war</code>. I try running:</p>

<pre><code>local version=$(java -jar /usr/share/jenkins/jenkins.war --version)
</code></pre>

<p>Unfortunately this prints several silly lines of output to stdout before the version number:</p>

<pre><code>Running from: /usr/share/jenkins/jenkins.war
webroot: $user.home/.jenkins
1.643
</code></pre>

<p>Is there a way to tell Jenkins to avoid printing the webroot and "running from" lines? It's annoying and I imagine any attempt to parse it (check the 3rd line of stdout) is prone to breaking in the future. </p>