Score:0

Java installed, but command isnt working

vn flag

A bit ago, when i didn't know how to use Linux, I was messing around with my filesystem. I must have deleted something important for java, because when I try to use the command, it doesn't work. I've tried removing and reinstalling java, and it doesn't work,

pi@raspberrypi:/home/pi$ sudo apt-get install defualt-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package defualt-jdk
pi@raspberrypi:/home/pi$ sudo apt install default-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
default-jdk is already the newest version (2:1.11-71+b1).
0 upgraded, 0 newly installed, 0 to remove and 228 not upgraded.
pi@raspberrypi:/home/pi$ java
-bash: java: command not found
pi@raspberrypi:/home/pi$ 
cocomac avatar
cn flag
This isn't enough for an answer, but... (1) you spelled 'default' incorrectly with the `apt-get` command. It should be `sudo apt-get install default-jdk` not `sudo apt-get install defualt-jdk`. Note that in the correct one, it is spelled 'default' not 'defualt' (the 'u' and the 'a' are switched). (2) It says `228 not upgraded`. This means you have over 200 packages that are out of date. Run `sudo apt update && sudo apt upgrade` to update them. Reboot your computer, try reinstalling Java one more time, and that might fix it.
Michael avatar
cn flag
Can you run the command again? See if that solves your issue. As cocomac said, make sure you spell it right.
N0rbert avatar
zw flag
What is your Ubuntu version? Have you tried to install `default-jre` package?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.