I initially had default-jdk and default-jre installed on Ubuntu 18.04.
Attempted to host a Minecraft Server for a friend, but was given the error found here
I followed the commentor's advice to reinstall java version 8 rather than version 11 installed above, by following this advice here that being
sudo rm -r /usr/lib/jvm/java-11-oracle
but as a mistake I had removed all files in that folder, leaving just the two directories
since then I have attempted to reinstall java using sudo apt-get install default-jdk ; sudo apt-get install default-jre
and they install just fine, but running java -version, either as root or as user, returns:
Command 'java' not found, but can be installed with:
I have scoured askubuntu, digitalocean, and stackoverflow for some answers but I can't find anything that fixes this problem. I also asked my roommate, who is an experienced Computer Science major and who has used ubuntu extensively in the past, and he couldn't find a solution. Has anyone encountered this issue before?
I appreciate any and all responses 😊
Solution has been found. Running:
sudo apt purge -y openjdk-11-jre-headless
sudo apt purge -y openjdk-8-jre-headless
sudo apt purge -y default-jdk
and reinstalling has resolved the issue