Skip to content

Fix: Added guard for jdk auto download#362

Open
codeholic-0 wants to merge 1 commit into
georgewfraser:masterfrom
codeholic-0:fix-download-jdk-before-build-linux
Open

Fix: Added guard for jdk auto download#362
codeholic-0 wants to merge 1 commit into
georgewfraser:masterfrom
codeholic-0:fix-download-jdk-before-build-linux

Conversation

@codeholic-0

Copy link
Copy Markdown
Contributor

link_linux: download JDK automatically if missing

Trying to MasonInstall java-language-server on Neovim gave the error:

         ◍ java-language-server
      ▼ Displaying full log
        Cloning git repository "https://github.com/georgewfraser/java-language-server.git"…
        Cloning into '.'...
        From https://github.com/georgewfraser/java-language-server
         * tag               v0.2.39    -> FETCH_HEAD
        + ./scripts/link_linux.sh
        Error: This JDK does not support linking from the current run-time image
        spawn: bash failed with exit code 2 and signal 0. Cloning into '.'...
        From https://github.com/georgewfraser/java-language-server
         * tag               v0.2.39    -> FETCH_HEAD
        + ./scripts/link_linux.sh

Because Mason is running ./script/link_linux.sh which doesn't auto download the jdk before linking and crahses
to fix added :

if [ ! -d "$JAVA_HOME" ]; then
    ./scripts/download_linux_jdk.sh
fi

Added a guard that downloads the jdk automatically if the target
directory doesn't exist, making the script self-contained.

…39 needs an update), that directly runs link_linux.sh and fails when no jdk is present
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

Successfully merging this pull request may close these issues.

1 participant