Home How to How to install Java in Kali Linux 2.0 – Kali Sana

How to install Java in Kali Linux 2.0 – Kali Sana

by blackMORE

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. How to install Java in Kali Linux 2.0 - Kali Sana - blackMORE Ops -3

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:

jdk-7u79-linux-x64.tar.gz

Download and save the file in /root directory.

Uncompress archive

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 leafpad / vi / text-editor.

To check the version of Java you are now running

java -version

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.

Use feedback

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.

You may also like

23 comments

336sec August 15, 2015 - 2:11 am

awesome works perfect

Reply
Alejandro Gabriel August 15, 2015 - 3:37 am

Funciona con java 8?

Reply
Sanjar Stone August 16, 2015 - 6:18 pm

Sí, como eso!

Reply
vRuS x0Ne August 16, 2015 - 10:36 pm

where is Main Menu ?? .. i cant find him … in kali 1.x it shows in Applications> System Tools> Perefrences > Main Menu

i want to add cobaltstrike and havij to the Applications Menu … Please Help me

Reply
karel capek August 19, 2015 - 9:18 am

having followed you through Kali 1.x on a dell t110ii, and 3 thinkpads x-31 (non-pae i386),w-500 (sweet, outlet.lenovo w/ ezserv), and this w-510, this java, iscan, ocrfeeder and HPLIP Debian8.0 work like a charm! I have no problem with the python 3, just miss the system-monitor panels at the top of the screen; vmware runs win8.1 and I’d love to monitor it as easily as I did with 1.1

Reply
2OnEzEbRa August 20, 2015 - 4:24 pm

FYI on that link…………….Easy way around it, obvious…..http://download.oracle.com/errors/download-fail-1505220.html
Sorry!
In order to download products from Oracle Technology Network you must agree to the OTN license terms.
Be sure that…
Your browser has “cookies” and JavaScript enabled.
You clicked on “Accept License” for the product you wish to download.
You attempt the download within 30 minutes of accepting the license.
From here you can go…
Back to Previous Page
Site Map
OTN Homepage

Reply
iamashishgk October 3, 2015 - 2:30 am

Nice and clean.. well done

Reply
J October 13, 2015 - 2:18 am

About time I find out how! Thank you!!!

Reply
J October 13, 2015 - 2:22 am

Actually still doesnt work in iceweasel

Reply
Whip October 16, 2015 - 3:52 am

version java 1.7.0_79 comes with the distro

Reply
kakamay October 30, 2015 - 6:49 am

you are the greatest

Reply
Les November 21, 2015 - 7:43 am

Hi, I download it and get this.

root@Desktop:~# tar -xzvf /root/jdk-7u79-linux-x64.tar.gz
tar (child): /root/jdk-7u79-linux-x64.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

I can’t seem to be able to install anything.

Reply
Zachary November 29, 2015 - 12:37 pm

Les, If you’re currently in the root directory try removing “/root/” – example: tar -xzvf jdk-7u79-linux-x64.tar.gz

Reply
imbe December 1, 2015 - 3:06 pm

E: Unable to locate package java
Why am i getting this kind of error in kali 2.0

Reply
kakamay December 26, 2015 - 4:08 pm

thank you guy!

Reply
sheep3 April 4, 2016 - 10:25 pm

3Q !

Reply
mohammed June 15, 2016 - 9:24 am

32 bit ????

Reply
بالکن شیشه ای December 17, 2017 - 4:05 pm

many thanks about this useful blog. it’s really helps me. thanks alot

Reply
طراحی سایت December 19, 2017 - 9:37 pm

Thanks a lot for sharing the dl link

Reply
ماشین آلات دوجداره December 19, 2017 - 11:05 pm

Great thanks

Reply
طراحی سایت January 20, 2018 - 6:03 pm

This is exactly the tutorial that one my friend needs. Thanks from you

Reply
طراحی و بهینه سازی سایت January 22, 2018 - 10:42 pm

About time I find out how! Thank you!!!

Reply
sepideimani October 11, 2019 - 5:51 pm Reply

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.