I am new to linux I have a Kali 2.0. I was trying to install jdk 8 on it. I couldn't do it via terminal. I downloaded the jdk package from Java website and extracted it using tar -xf to my home directory Added the directory containing javac to my path variable permanently. And I removed the existing Java 1.7 It said something like /usr/bin/javac missing. I guess I was feeling really stupid but I copied all the files from the jdk folder I downloaded onto /usr/bin/ and tried the javac command. This time it said some lib file wasn't found so I opened each folder from the jdk folder I downloaded and copied all the files and not the folders from each folder onto the /usr/bin/ directory. I have no idea what I did but now when I try to install the old jdk I had (using apt-get install openjdk-7-jdk) it gets installed but then when I try javac , I get the same message some lib file is missing. Could someone please tell me what I did to my system and how can I fix it?

  • Did you remove the existing Java 1.7 package using apt-get? – Peschke Jun 8 '16 at 19:02
  • Yes I did remove it. – Ashwin K Joseph Jun 8 '16 at 19:03
  • What happened when you tried installing JDK 8? I see openjdk-8 in their repositories. pkg.kali.org/pkg/openjdk-8 – Peschke Jun 8 '16 at 19:06
  • It said it didn't exist when I tried that command – Ashwin K Joseph Jun 8 '16 at 19:06
  • I tried apt-get install openjdk-8-jdk because that was the command for 1.7. and that worked so I thought the command for 8 would be similar. – Ashwin K Joseph Jun 8 '16 at 19:08

I still have no idea on what effect adding extra files and replacing files at /usr/bin will do. I guess I'll have to wait and see whether applications will start to crash or not and repair them.

But here is the good news, I finally got the jdk8 installed. Since no other way was work for me.. I made a link to the javac file in the original file that I externally downloaded onto my home directory and placed this link in /usr/bin/ directory and renamed the link as javac and deleted the javac I copied onto the directory earlier. And guess what.. it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.