ADLINK-IST/opensplice

Java version detected as 0

Opened this issue · 1 comments

$ javac -version
javac 11.0.3
$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)

From bin/checkconf:

    "$JAVAC_EXE" -version 2> javac.ver
    JAVAC_REAL_VERSION=`cat javac.ver | grep "javac" | head -1 | awk '{ print $2 }'`
    JAVAC_VERSION=`echo $JAVAC_REAL_VERSION | awk -F'.' '{ print $1"."$2 }' | sed -e 's;\.;0;g'`
    rm -f javac.ver

Using 2> redirects standard error only, resulting in an empty file, leading to a version number of 0, which is less than 106.

Workaround:

Change 2> to &> and it will work for both stderr and stdout.

sed -i 's/version 2> /version \&> /' bin/checkconf 

Dear Deve,

Thank you for your comment. I really appreciate your suggestion. We will test this case and consider your workaround if it is required.

With best regards,
Vivek K Pandey
Solutions Architect
ADLINK Technology, SAT