Configuring Oracle Java Development Kit (JDK) on CrunchBang Linux 11

duke-jdk8-1

Download Java SE Development Kit for Linux (jdk-8*.tar.gz), respective to architecture (x86 or x64), from here.

###
# This will navigate to the downloads folder, un-zip the jdk-8*.tar.gz archive,
# and move extracted folder to ‘/usr/lib/jvm/’.
##

cd ~/downloads
tar xvfz jdk-8*.tar.gz
sudo su
if [ ! -d '/usr/lib/jvm' ]; then mkdir /usr/lib/jvm; fi
chown -R root:root jdk1.8*
mv jdk1.8* /usr/lib/jvm/

###
# This updates the current system Java and SE Runtime
# Environment to JDK 8.
##

cd ~/downloads
sudo su
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8*/bin/java 1065
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8*/bin/javac 1065
update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8*/bin/jar 1065
update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8*/bin/javaws 1065

###
# This allows the user to check or set the current system Java and SE Runtime
# Environment, the exit. If prompted, press enter to keep current choice.
##

update-alternatives --config java
exit

###
# This checks the current system Java version.
##

java -version
Advertisements

One thought on “Configuring Oracle Java Development Kit (JDK) on CrunchBang Linux 11

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s