File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,16 +53,20 @@ cd $ANDROID_HOME
5353
5454export PATH=" $PATH :$ANDROID_HOME /cmdline-tools/latest/bin"
5555
56- # Save original JAVA_HOME .
57- OG_JAVA_HOME= $JAVA_HOME
56+ # Only needed if OpenJDK is not disabled .
57+ # checked as Java Feature installs it via sdkman causing “update-alternatives: error: no alternatives for javac”
5858
59- # thanks https://askubuntu.com/questions/772235/how-to-find-path-to-java#comment2258200_1029326.
59+ if [ $DISABLE_OPENJDK_INSTALLATION != " true" ]; then
60+ LINUX_PACKAGES=(" ${LINUX_PACKAGES[@]} " " openjdk-17-jdk-headless" )
6061
61- # checking the output as dirname is returning “.”
62+ # Save original JAVA_HOME.
63+ OG_JAVA_HOME=$JAVA_HOME
6264
63- javac --version
65+ # thanks https://askubuntu.com/questions/772235/how-to-find-path-to-java#comment2258200_1029326.
6466
65- export JAVA_HOME=$( dirname $( dirname $( update-alternatives --list javac 2>&1 | head -n 1) ) )
67+ export JAVA_HOME=$( dirname $( dirname $( update-alternatives --list javac 2>&1 | head -n 1) ) )
68+
69+ fi
6670
6771# TODO: Update everything to future-proof for the link getting stale.
6872# yes | sdkmanager "cmdline-tools;latest"
You can’t perform that action at this time.
0 commit comments