I am trying to update java to version 11 with this script step:
#!/usr/bin/env bash
set -ex
/usr/libexec/java_home -V
brew cask install java11
export JAVA_HOME=`/usr/libexec/java_home -v 11.0`
export PATH=$PATH:$JAVA_HOME/bin
source ~/.bash_profile
echo "Java version check:"
/usr/libexec/java_home -V
echo "Java version check:"
java -version
last command is always shows java 8. How can I resolve that? I tried Hybrid stack already and it does not work.
The reason to have java 11 is that we need it for SonarQube step. (after uploading to sonarcloud it shows a warning that java 8 will be deprecated in October 2020)
Just wanted to update here with good news! The stacks now have both openjdk 8 and openjdk 11 installed. By default, openjdk 8 will be active. To change to use openjdk 11, you just need a simple script step. Instructions and what needs to be in the script - - all documented in our devcenter!