changing version infomation string of 'java -version'

Severin Gehwolf sgehwolf at redhat.com
Fri Jun 21 18:13:30 UTC 2019


Hi,

On Fri, 2019-06-21 at 19:39 +0000, Matthias Apitz wrote:
> Hello,
> 
> We have ported OpenJDK to our Solaris SPARC servers and have a small
> issue now:
> 
> The (older) Oracle Java says about the version:
> 
> sisis at srap13dsr1:> jdk1.8.0_31/bin/java -version
> java version "1.8.0_31"
> Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
> 
> Our compilation of OpenJDK says:
> 
> sisis at srap13dsr1:> openjdk8/bin/java -version
> openjdk version "1.8.0-internal"
> OpenJDK Runtime Environment (build 1.8.0-internal-sisis_2019_05_23_13_28-b00)
> OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)
> 
> So far so good. The problem is that our software packages which need
> Java are checking during installation the version string of Java and this
> a bit hardwired. This would mean updating our packages so that they
> accept the new OpenJDK. Or is there any correct configuration way to let
> OpenJDK's Java punch the old version string 'java version "1.8.0_31"' ?

There are a couple of things you need to know. First off, is this going
to be a tag which got deemed GA, like jdk8u212-b03 from [1]? Otherwise
you should make it clear (via version output) that this is *not* a GA
release, but an internal build. It could look like the one you've
posted. The EA builds identify as such. Example:

$ ./openjdk-8u222-b06/bin/java -version
openjdk version "1.8.0_222-ea"
OpenJDK Runtime Environment (build 1.8.0_222-ea-b06)
OpenJDK 64-Bit Server VM (build 25.222-b06, mixed mode)

Having said that, the upstream OpenJDK 8u project builds[2] have build
scripts which could give some guidance (for such a jdk8u212-b03 GA
build):

https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/blob/jdk8u212-b03/build-openjdk8.sh#L29

That produces this -version output:

$ ./openjdk-8u212-b03/bin/java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

HTH,
Severin

[1] http://hg.openjdk.java.net/jdk8u/jdk8u
[2] https://adoptopenjdk.net/upstream.html




More information about the build-dev mailing list