Install JDK in Debian

1. Donload jdk package from Oracle:

wget --header "Cookie: oraclelicense=accept-securebackup-cookie"
2. Setop JDK Environment
sudo sumkdir /opt/jdk
tar -zxf jdk-8u40-linux-x64.tar.gz -C /opt/jdk
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_40/bin/java 100
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_40/bin/javac 100
3. Check Java Environment. To check the java environment, you just use this command:
java –version

The console will prompt message like this:
java version “1.8.0_40”
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

If you get the following message while using java commend:
bash: /usr/bin/java: No such file or directory
This problem is due to lack of libc6-i386 package. Use the following command to install it and then java can be run.
sudo apt-get install libc6-i386

1. Digital , "How To Manually Install Oracle Java on a Debian or Ubuntu VPS", Digital Ocean Community. Available: [Online]

This entry was posted in Java, Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *