ChatGPT says it is possible to have PKGBUILD detect if the user has jdk21-jetbrains-bin installed, and if they do, offer them the option to use that instead of the bundled one:
if pacman -Q jdk21-jetbrains-bin > /dev/null 2>&1; then
echo "Detected jdk21-jetbrains-bin. Would you like to use this instead of the bundled JetBrains JDK? (y/N)"
read use_system_jdk
if [[ $use_system_jdk == "y" || $use_system_jdk == "Y" ]]; then
export JDK_PATH="/usr/lib/jvm/jdk21-jetbrains-bin"
else
export JDK_PATH="bundled_jdk_path"
fi
fi
Pinned Comments