Installing jdk8 on ubuntu- “unable to locate package” update doesn’t fix

I’ve been trying to install the jdk on my ubuntu after downloading it.

first I’ve used: sudo apt-get update

then: sudo apt-get install jdk* (because I didn’t want to write the whole long name).

it didn’t work- printed the message in the title.

I thought the problem might me with the directory I’m executing from (I’ve executed it from the Downloads directory in which the file exists), so I’ve tried executing the same command (sudo apt-get install jdk*) from the home directory (root directory). Then it worked.. the whole installation took about 5 minutes and it looked like it was installing a lot of things I didn’t ask for.

I wasn’t sure it installed what I needed to I went back to the Downloads directory where the jdk8 package was located and like the first time ran the command from there. the same message as before… couldn’t locate the package.

What have I done wrong ? Obviously it wasn’t installed because when I’ve checked the version of java (java -version) it didn’t show jdk8 was installed.

Thank you if you’ve taken the time to read to this point 🙂

Leave a Comment