This is no bug.
Likely your system has jdk-openjdk or jre-openjdk which has been updated to v18.
Follow the advise in the message
check your java version
archlinux-java status
install or set a supported version
sudo pacman -Syu jdk17-openjdk
Then set the version
archlinux-java set jdk17-openjdk