PDA

View Full Version : Installing Java on Kali-Linux



purehate
2013-03-13, 21:05
1. Download the latest Java SE SDK version.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

At the time of writing the filename and version was jdk-7u17-linux-x64.tar.gz

2. Untar the Archive
tar -xzvf /root/jdk-7u17-linux-x64.tar.gz
mv jdk1.7.0_17 /opt
cd /opt/jdk1.7.0_17

3.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_17/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_17/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.7.0_17/bin/java
update-alternatives --set javac /opt/jdk1.7.0_17/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so

4. Test

To check the version of Java you are now running

java -version

To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”

Dark_4ngel
2013-03-14, 15:24
i think step 3 dosen't work since when i try java -version i get
bash: /usr/bin/java: cannot execute binary file

fishynio
2013-03-14, 21:02
i think step 3 dosen't work since when i try java -version i get
bash: /usr/bin/java: cannot execute binary file



everything works, just download&install 32 bit version instead of 64 bit.

And in step 3 change /amd64/ to /i386/

brav0hax
2013-03-14, 21:45
In the steps above it is using 64bit software, Dark_4ngel, are you running a 64Bit Kali install or 32?

Not sure but that may be the issue.

gamercndg
2013-03-15, 06:24
Confirmed working.

root@localhost:~# tar -xzvf jdk-7u17-linux-x64.tar.gz
jdk1.7.0_17/
jdk1.7.0_17/include/
[..]
root@localhost:~# mv jdk1.7.0_17 /opt
root@localhost:~# cd /opt/jdk1.7.0_17/
root@localhost:/opt/jdk1.7.0_17#
root@localhost:/opt/jdk1.7.0_17# update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_17/bin/java 1
root@localhost:/opt/jdk1.7.0_17# update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_17/bin/javac 1
root@localhost:/opt/jdk1.7.0_17# update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so 1
update-alternatives: /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so wird verwendet, um /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) im Auto-Modus bereitzustellen
root@localhost:/opt/jdk1.7.0_17# update-alternatives --set java /opt/jdk1.7.0_17/bin/java
update-alternatives: /opt/jdk1.7.0_17/bin/java wird verwendet, um /usr/bin/java (java) im manueller Modus bereitzustellen
root@localhost:/opt/jdk1.7.0_17# update-alternatives --set javac /opt/jdk1.7.0_17/bin/javac
update-alternatives: /opt/jdk1.7.0_17/bin/javac wird verwendet, um /usr/bin/javac (javac) im manueller Modus bereitzustellen
root@localhost:/opt/jdk1.7.0_17# update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so
root@localhost:/opt/jdk1.7.0_17# java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

#n3|2dc0d3d
2013-03-16, 04:14
everything's working bro...

bond benz
2013-03-16, 15:42
Nice thank you.

SilentReader
2013-03-24, 15:49
it's working....thanks....

someshwarceh
2013-03-24, 18:15
Thank you for your useful information.

w3n0x
2013-04-02, 18:44
Thank you...

koz
2013-04-02, 20:16
Thanks brah! Worked exactly as described (64bit)

dropdead
2013-04-05, 05:02
thanks bro worked for me ;)

ddos
2013-04-13, 18:09
thanks pro....

Mr.Fahad
2013-04-15, 19:07
Not Working With me Pls Help

r3ng4f
2013-04-16, 00:09
Install the package icedtea-7-plugin command like:

# apt-get install icedtea-7-plugin

Restart your browser and test.

I hope I helped.

imabuvu
2013-04-28, 17:47
Is it some major problem to update java after i install it
- after i installed 17 it says update 21 is available and i don't feel like getting burned right now:)

newkaliuser
2013-05-04, 04:12
tar -xzvf /root/jdk-7u21-linux-i586.tar.gz

mv jdk1.7.0_21 /opt

cd /opt/jdk1.7.0_21

update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_21/bin/javac 1

update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_21/jre/lib/i386/libnpjp2.so 1

update-alternatives --set java /opt/jdk1.7.0_21/bin/java

update-alternatives --set javac /opt/jdk1.7.0_21/bin/javac

update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_21/jre/lib/i386/libnpjp2.so

VampireS
2013-05-04, 16:05
This tutorial is for 64 bit and 32bit but it works with some minor changes:

1. Download the latest Java SE SDK version.

At the time of writing the filename and version was jdk-7u21-linux-i586.tar.gz

2. Untar the Archive
tar -xzvf /root/jdk-7u21-linux-i586.tar.gz
mv jdk1.7.0_21 /opt
cd /opt/jdk1.7.0_21

3.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_21/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_21/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_21/jre/lib/i384/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.7.0_21/bin/java
update-alternatives --set javac /opt/jdk1.7.0_21/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_21/jre/lib/i386/libnpjp2.so

4. Test

To check the version of Java you are now running

http://java.com/en/download/testjava.jsp

Hyperion
2013-05-05, 16:23
will test later, and give feedback, thanks! :)...

samcn
2013-05-08, 06:57
Post post post

Amidamaru
2013-06-26, 09:17
sudo apt-get purge openjdk* - I'm not sure that it's a good ideea. By doing that you'll got to handle such:

"The following packages will be REMOVED:
android-sdk* ant* ant-optional* apktool* armitage* bluepot* burpsuite*
ca-certificates-java* casefile* dbpwaudit* default-jdk* default-jre*
default-jre-headless* dex2jar* dirbuster* icedtea-6-jre-cacao*
icedtea-6-jre-jamvm* icedtea-7-jre-cacao* icedtea-7-jre-jamvm* icedtea-netx*
javasnoop* magictree* maltego* metasploit* openjdk-6-jdk* openjdk-6-jre*
openjdk-6-jre-headless* openjdk-6-jre-lib* openjdk-7-jdk* openjdk-7-jre*
openjdk-7-jre-headless* openjdk-7-jre-lib* oscanner* paros* patator*
protos-sip* smali* vega* webscarab* xmind* zaproxy*

The following NEW packages will be installed:
gcj-4.7-base gcj-4.7-jre gcj-4.7-jre-headless gcj-4.7-jre-lib gcj-jre
gcj-jre-headless libgcj-common libgcj13 libgcj13-awt
0 upgraded, 9 newly installed, 41 to remove and 0 not upgraded.
Need to get 24.5 MB of archives.
After this operation, 996 MB disk space will be freed.
"
Think twice before say YES.

Amidamaru
2013-06-26, 09:36
Install the package icedtea-7-plugin command like:

# apt-get install icedtea-7-plugin

Restart your browser and test.

I hope I helped.

Thank you mate. One of the most simple and safest solution. 100% worked out.

altjx
2013-07-09, 14:41
It seems like Java breaks for me every time there's a new update or something available. I'm not sure what the deal is. One minute it works, the next minute it doesn't. I always find myself having to come back to this thread, downloading a newer version of Java, and then executing those commands again.

Is there any way I could get some assistance diagnosing this? Pretty annoying to have it stop working all of a sudden.

enoks
2013-07-23, 08:05
UPDATED THIS POST FOR versions x86
java version (jdk-7u25-linux-i586)

1. Download the latest Java SE SDK version.

http://www.oracle.com/technetwork/ja...ads/index.html

The version at the time i did the post jdk-7u25-linux-i586.tar.gz

2. Untar the Archive
tar -xzvf /root/jdk-7u17-linux-x64.tar.gz
mv jdk1.7.0_17 /opt
cd /opt/jdk1.7.0_17

3.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_25/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_25/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_25/jre/lib/i386/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.7.0_25/bin/java
update-alternatives --set javac /opt/jdk1.7.0_25/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_25/jre/lib/i386/libnpjp2.so

4. Test

To check the version of Java you are now running

java -version

To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”

Keep Up

TheCoder
2013-08-16, 17:54
I have a problem in the last step , your help plzzz !!!

root@Kali-PC:/opt/jdk1.7.0_25# update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_25/bin/java 1
root@Kali-PC:/opt/jdk1.7.0_25# update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_25/bin/javac 1
root@Kali-PC:/opt/jdk1.7.0_25# update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_25//jre/lib//i386/libnpjp2.so 1
update-alternatives: using /opt/jdk1.7.0_25//jre/lib//i386/libnpjp2.so to provide /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) in auto mode
root@Kali-PC:/opt/jdk1.7.0_25# update-alternatives --set java /opt/jdk1.7.0_25/bin/java
update-alternatives: using /opt/jdk1.7.0_25/bin/java to provide /usr/bin/java (java) in manual mode
root@Kali-PC:/opt/jdk1.7.0_25# update-alternatives --set javac /opt/jdk1.7.0_25/bin/javac
update-alternatives: using /opt/jdk1.7.0_25/bin/javac to provide /usr/bin/javac (javac) in manual mode
root@Kali-PC:/opt/jdk1.7.0_25# update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_25//jre/lib/i386/libnpjp2.so
update-alternatives: error: alternative /opt/jdk1.7.0_25//jre/lib/i386/libnpjp2.so for mozilla-javaplugin.so not registered; not setting

venom
2013-08-26, 01:11
hurrah its done i have java installed on my kali os

Shocky
2013-08-28, 15:06
Worked perfectly thanks.

26astr00
2013-09-01, 19:55
When I type
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_25/jre/lib/amd64/libnpjp2.so 1
it gives me
update-alternatives: erreur: le chemin alternatif /opt/jdk1.7.0_25/jre/lib/amd64/libnpjp2.so n'existe pas
which means that that pathway doen't exist, can someone help me plz? :/

Chris_Cy
2013-09-15, 01:05
Thanks a lot, works perfectly with jdk1.7.0_40

engwla2
2013-09-24, 01:28
I tried this method and succeeded

after the download from the link
http://www.java.com/en/download/index.jsp
#ls
#tar zxvf jre-7u40-linux-x64.tar.gz
#killall -9 /opt/firefox/firefox-bin
#mkdir /opt/java
#update-alternatives --install /usr/bin/java java /opt/java/jre1.7.0_40/bin/java 1
#update-alternatives --set java /opt/java/jre1.7.0_40/bin/java
#ln -sf /opt/java/jre1.7.0_40/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/
#export JAVA_HOME="/opt/java/jre1.7.0_40/bin/java"
#firefox http://java.com/en/download/testjava.jsp

for more information
http://www.backtrack-linux.org/wiki/index.php/Java_Install

engwla2
2013-09-24, 06:09
After downloading the latest version 7.0-40 Java you should change the number 7 in all orders to 40 and Enjoy:o

tar -xzvf /root/jdk-7u40-linux-x64.tar.gz
mv jdk1.7.0_40 /opt
cd /opt/jdk1.7.0_40


update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_40/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_40/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_40/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.7.0_40/bin/java
update-alternatives --set javac /opt/jdk1.7.0_40/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_40/jre/lib/amd64/libnpjp2.so

The above commands are used for 64-bit Systems:)

profglavcho
2013-10-27, 07:02
any idea howto install sun jdk 6?
android build system not working with other version
thanks

crowetic
2013-11-20, 01:23
UPDATED THIS POST FOR versions x86
java version (jdk-7u25-linux-i586)

1. Download the latest Java SE SDK version.

http://www.oracle.com/technetwork/ja...ads/index.html

The version at the time i did the post jdk-7u25-linux-i586.tar.gz

2. Untar the Archive
tar -xzvf /root/jdk-7u17-linux-x64.tar.gz
mv jdk1.7.0_17 /opt
cd /opt/jdk1.7.0_17

3.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_25/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_25/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_25/jre/lib/i386/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.7.0_25/bin/java
update-alternatives --set javac /opt/jdk1.7.0_25/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_25/jre/lib/i386/libnpjp2.so

4. Test

To check the version of Java you are now running

java -version

To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”

Keep Up


Thank you! Followed these steps exactly with 32bit and the newest version of java simply changing the 25 to a 45 and everything worked flawlessly. Much appreciated. :)

sHAKaJaada
2013-11-28, 16:46
Working like described! THX

kalashnikov
2013-11-30, 14:57
thxxxxxxxxxxxxxxxxxxxxxxxx

AirSky27
2013-12-07, 18:48
It's Still Work for jdk-7u45-linux-x64.tar.gz thank you Bro.. ;);)

rheia
2014-03-07, 03:37
thanks for the guide.
just adding, this is for jdk download, for other download like jre, the folder name and subfolders will be a bit different and you have to adjust yourself.

jwg
2014-03-19, 02:17
1. Download the latest Java SE SDK version.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

At the time of writing the filename and version was jdk-7u17-linux-x64.tar.gz

2. Untar the Archive
tar -xzvf /root/jdk-7u17-linux-x64.tar.gz
mv jdk1.7.0_17 /opt
cd /opt/jdk1.7.0_17

3.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_17/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_17/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.7.0_17/bin/java
update-alternatives --set javac /opt/jdk1.7.0_17/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so

4. Test

To check the version of Java you are now running

java -version

To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”

In case people are still using these instructions, I thought I'd report that I used them to get java working using jdk-7u51-linux-x64.tar.gz. I just changed all the _17 to _51. However, the interesting thing to me was that I got a message saying there was an error. But never the less it all worked.

halo
2014-03-29, 18:13
Why am I approched by this error?

root@kali:/opt/jdk1.7.0_51# update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_51/bin/java 1
update-alternatives: error: alternative path /opt/jdk1.7.0_51/bin/java doesn't exist


My post about fixing E0F error(which i assume youre talking about jwg) hasnt been approved yet.

rjay410
2014-04-22, 17:39
i know im just doing asomething stupid but when i do step 3 -
install /usr/bin/java java /opt/jdk1.7.0_17/bin/java 1

i get no directory 1 help please

pravin0123
2014-11-01, 14:25
So I get a message while using firefox that I need a java update on my browser. The warning window does not close in spite of having a leave the page button. Even after restarting and deleting temp files, this window has now closed. I feel its malware and my norton antivirus has not worked.

I already feel my yahoo mail has been compromised, I am being asked to suddenly change my password.

then i cleared these issues by following few steps over a article post.
http://www.omgtop5.com/how-to-verify-install-update-java-for-windows-browsers/

i make that per-requirement to browsers under your OS, checking the prefect driver of java for both system and browsers. verify by mail, updates ....finally issues will be clear, sometimes without update its will be installs the default version from download center.

Brent85
2015-03-13, 20:24
Thanks, you saved me many struggles getting java jdk to work.

thymikon
2015-10-14, 14:09
well :D necropost
but thx to this topic :D
was helpfull

Joeparmar
2015-11-29, 18:00
"How can i copy my already downloaded jdk-7u17-linux-x64.tar.gz file to root folder.? "

rvasquez
2016-02-07, 16:57
Works on Kali 2016.1 jdk 8u73, just replace the version number, right know I have an issue with Webex but I'm figuring out how to solve

shinox
2016-03-03, 10:38
In case anyone feel lazy please see the script you can use to automate it - ofcourse based solely on idea published by author of the thread (thank you for this):

# 1. Download the latest Java SE SDK version.

# http://www.oracle.com/technetwork/ja...ads/index.html
#
# cd to directory where .gz has been downloaded
#
# 2. pass the archive as an argument to the script -> script.sh jdk-7u17-linux-x64.tar.gz
#
# Default location is /usr/java for me - don't like it just pass /opt or /opt/java as second argument
# For example: script.sh jdk-7u17-linux-x64.tar.gz /opt/java
#
# The script heavily based on author's idea, please copy save it to script.sh of javaAlternatives.sh or else..
#

#!/bin/bash
#

tar -xzvf $1
echo "extracted"

JAVA_WHERE_TO=$2

JAVA_VER=$(ls . | grep 'jdk[[:digit:].[:digit:].[:digit:]]_*')
echo "Found java: " $JAVA_VER

if [[ ! $JAVA_WHERE_TO ]]; then
JAVA_WHERE_TO="/usr/java"
fi

mkdir -p $JAVA_WHERE_TO
mv $JAVA_VER $JAVA_WHERE_TO/

update-alternatives --install /usr/bin/java java $JAVA_WHERE_TO/$JAVA_VER/bin/java 1
update-alternatives --install /usr/bin/javac javac $JAVA_WHERE_TO/$JAVA_VER/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so $JAVA_WHERE_TO/$JAVA_VER/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java /usr/java/$JAVA_VER/bin/java
update-alternatives --set javac /usr/java/$JAVA_VER/bin/javac
update-alternatives --set mozilla-javaplugin.so /usr/java/$JAVA_VER/jre/lib/amd64/libnpjp2.so


# To check the version of Java you are now running
echo ">----- Testing Java -----<"
java -version

# To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”
nohup x-www-browser http://www.java.com/ &
## END of the script

## To use the plugin you need to adjust java security settings cause in some cases it won't work.

# Again thank you to the author for this idea

shinox
2016-03-03, 10:51
In case anyone feel lazy please see the script you can use to automate it - ofcourse based solely on idea published by author of the thread (thank you for this):

# 1. Download the latest Java SE SDK version.

# http://www.oracle.com/technetwork/ja...ads/index.html
#
# cd to directory where .gz has been downloaded
#
# 2. pass the archive as an argument to the script -> script.sh jdk-7u17-linux-x64.tar.gz
#
# Default location is /usr/java for me - don't like it just pass /opt or /opt/java as second argument
# For example: script.sh jdk-7u17-linux-x64.tar.gz /opt/java
#
# The script heavily based on author's idea, please copy save it to script.sh of javaAlternatives.sh or else..
#

#!/bin/bash
#

tar -xzvf $1
echo "extracted"

JAVA_WHERE_TO=$2

JAVA_VER=$(ls . | grep 'jdk[[:digit:].[:digit:].[:digit:]]_*')
echo "Found java: " $JAVA_VER

if [[ ! $JAVA_WHERE_TO ]]; then
JAVA_WHERE_TO="/usr/java"
fi

mkdir -p $JAVA_WHERE_TO
mv $JAVA_VER $JAVA_WHERE_TO/

update-alternatives --install /usr/bin/java java $JAVA_WHERE_TO/$JAVA_VER/bin/java 1
update-alternatives --install /usr/bin/javac javac $JAVA_WHERE_TO/$JAVA_VER/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so $JAVA_WHERE_TO/$JAVA_VER/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java $JAVA_WHERE_TO/$JAVA_VER/bin/java
update-alternatives --set javac $JAVA_WHERE_TO/$JAVA_VER/bin/javac
update-alternatives --set mozilla-javaplugin.so $JAVA_WHERE_TO/$JAVA_VER/jre/lib/amd64/libnpjp2.so


# To check the version of Java you are now running
echo ">----- Testing Java -----<"
java -version

# To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”
nohup x-www-browser http://www.java.com/ &
## END of the script

## To use the plugin you need to adjust java security settings cause in some cases it won't work.

# Again thank you to the author for this idea

Andrew Stallard
2016-06-26, 07:59
I have a 32-bit system and yes I made the necessary modifications but I still get this error upon running java -version

Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

I am not sure where the error occurred since nothing like this happened when I used the commands.

Here are the actual commands I used:

update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_92/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_92/bin/javac 1
update-aternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.8.0_92/jre/lib/i386/libjawt.so 1
update-alternatives --set java /opt/jdk1.8.0_92/bin/java
update-alternatives --set javac /opt/jdk1.8.0_92/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.8.0_92/jre/lib/i386/libjawt.so

I executed all of these from the directory:

root@myComputer:/opt/jdk1.8.0_92#

One thing I did is that I extracted the contents to my home directory then later copied the jdk1.8.0_92 directory and all of its contents to the /opt directory later. I doubt that makes any difference but I'm willing to try anything at this point.

If anybody else had a similar issue please respond.

dhammuvirus
2016-11-30, 09:42
NEED not to perform this much things... simple go and download script run and woooha java updated..
https://cyberghosts.wordpress.com/2016/11/30/update-java-in-kali-linux
:cool:

ToxicDesire11
2017-05-10, 02:56
was looking for this. Thanks! it worked.

kap415
2017-11-05, 16:07
laws yes!! this was the juice! thank you!