Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java version detected as 0 #163

Open
ghost opened this issue Dec 23, 2020 · 1 comment
Open

Java version detected as 0 #163

ghost opened this issue Dec 23, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 23, 2020

$ 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 
@vivekpandey02
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant