This post will outline the steps required to install Java in Kali Linux 2.0 – Kali Sana. This post got the same instructions which also applies to Kali Linux 1.x and it’s still valid. I’ve had other readers confirming the process. Do verify and if it worked for you, let me know via comments section. I’ve also updated instructions for latest Java SE Development Kit 7u79 i.e. jdk-7u79-linux-x64.tar.gz, so you can pretty much copy paste it as long the versions are matching. Otherwise, replace the version number and you will be fine.
So lets get on with the installation:
Download latest Java SE SDK
At the time of writing this guide the jdk version was jdk-7u79-linux-x64.tar.gz. Note that I’m using x64 which is 64-bit. 32-bit users should choose their versions accordingly. Not that tough really!
Following is what I’ve used in this guide:
Download and save the file in
Now you uncompress and move the whole uncompressed folder to
/opt (optional) directory.
tar -xzvf /root/jdk-7u79-linux-x64.tar.gz mv jdk1.7.0_79 /opt cd /opt/jdk1.7.0_79
Install and register binaries
This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:
update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_79/bin/java 1 update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_79/bin/javac 1 update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_79/jre/lib/amd64/libnpjp2.so 1 update-alternatives --set java /opt/jdk1.7.0_79/bin/java update-alternatives --set javac /opt/jdk1.7.0_79/bin/javac update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_79/jre/lib/amd64/libnpjp2.so
Testing your installation
First of all, close your browser and re-open. You won’t believe how many users actually forgets to do this step and later complains Java ain’t working. I’d advise to bookmark this site to be able to reopen these instructions quickly, or simply copy these into a
To check the version of Java you are now running
To check the browser plugin just click Do I have Java?
This should take you to Oracles Java website and you will see a confirmation message.
I also had this following Feedback/comment here which confirms this process.
Thanks Robert for your quick feedback.
Thanks for reading. I sure hope you will be able to install Java in Kali Linux 2.0 using this method. If this helped you, comment below and do share with others.