Installasi Oracle JDK 7 pada Ubuntu 11.10


Okey, setelah menginstall Oracle JDK 7 tanpa synaptic atau apt,  browser google chrome saya menjadi tidak berfungsi dengan baik ketika berhadapan dengan java applet dan sejenisnya. Setelah bergoogling ria akhirnya saya mendapat pencerahan (beeeiihhh mudah!!!!)… Supaya sama – sama cerah bagi yang merasa gelap pikiran, saya bagi oprekan script plus langkah – langkah nya.

 

Langkah Pertama ,

  1. Download JDK 7 pada link berikut ini : http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.tar.gz
  2. Pastikan anda mendownload JDK dengan extensi file tar.gz

Jika anda telah selesai mendownload tulis sintaks berikut ini pada terminal anda :

cp jdk-7u1-linux-i586.tar.gz /opt/
cd /opt/
tar -xvzf jdk-7u1-linux-i586.tar.gz

Langkah Kedua,

Buka Text Editor atau nano dan isi dengan sintaks berikut ini :

#!/bin/bash
#Iseng - Iseng VTHINK

echo "Please Enter Your JAVA HOME (e.g /opt/jdk1.7.0) : "
read java_dir

echo "Creatng symlink in /usr/lib/jvm/java-7-sun.."
ln -s $java_dir /usr/lib/jvm/java-7-sun

echo "Creating Environment JAVA_HOME.."
JAVA_HOME=/usr/lib/jvm/java-7-sun
export JAVA_HOME

echo "Creating PATH Environment JAVA_HOME.."
PATH=$PATH:$JAVA_HOME/bin:
export PATH

echo "Creating CLASSPATH Environment JAVA_HOME.."
CLASSPATH=$JAVA_HOME/lib/:.
export CLASSPATH

echo "Please Enter Your Java Architecture (i386/amd64) : "
read java_arch


echo "Do update-alternatives..."
update-alternatives --quiet --install /usr/lib/xulrunner-addons/plugins/libjavaplugin.so xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-7-sun/jre/lib/$java_arch/libnpjp2.so 63
update-alternatives --quiet --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-7-sun/jre/lib/$java_arch/libnpjp2.so 63
update-alternatives --quiet --install /usr/bin/appletviewer appletviewer /usr/lib/jvm/java-7-sun/bin/appletviewer 63 --slave /usr/share/man/man1/appletviewer.1 appletviewer.1 /usr/lib/jvm/java-7-sun/man/man1/appletviewer.1
update-alternatives --quiet --install /usr/bin/apt apt /usr/lib/jvm/java-7-sun/bin/apt 63 --slave /usr/share/man/man1/apt.1 apt.1 /usr/lib/jvm/java-7-sun/man/man1/apt.1
update-alternatives --quiet --install /usr/bin/extcheck extcheck /usr/lib/jvm/java-7-sun/bin/extcheck 63 --slave /usr/share/man/man1/extcheck.1 extcheck.1 /usr/lib/jvm/java-7-sun/man/man1/extcheck.1
update-alternatives --quiet --install /usr/bin/idlj idlj /usr/lib/jvm/java-7-sun/bin/idlj 63 --slave /usr/share/man/man1/idlj.1 idlj.1 /usr/lib/jvm/java-7-sun/man/man1/idlj.1
update-alternatives --quiet --install /usr/bin/jar jar /usr/lib/jvm/java-7-sun/bin/jar 63 --slave /usr/share/man/man1/jar.1 jar.1 /usr/lib/jvm/java-7-sun/man/man1/jar.1
update-alternatives --quiet --install /usr/bin/jarsigner jarsigner /usr/lib/jvm/java-7-sun/bin/jarsigner 63 --slave /usr/share/man/man1/jarsigner.1 jarsigner.1 /usr/lib/jvm/java-7-sun/man/man1/jarsigner.1
update-alternatives --quiet --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 63 --slave /usr/share/man/man1/javac.1 javac.1 /usr/lib/jvm/java-7-sun/man/man1/javac.1
update-alternatives --quiet --install /usr/bin/javadoc javadoc /usr/lib/jvm/java-7-sun/bin/javadoc 63 --slave /usr/share/man/man1/javadoc.1 javadoc.1 /usr/lib/jvm/java-7-sun/man/man1/javadoc.1
update-alternatives --quiet --install /usr/bin/javah javah /usr/lib/jvm/java-7-sun/bin/javah 63 --slave /usr/share/man/man1/javah.1 javah.1 /usr/lib/jvm/java-7-sun/man/man1/javah.1
update-alternatives --quiet --install /usr/bin/javap javap /usr/lib/jvm/java-7-sun/bin/javap 63 --slave /usr/share/man/man1/javap.1 javap.1 /usr/lib/jvm/java-7-sun/man/man1/javap.1
update-alternatives --quiet --install /usr/bin/jconsole jconsole /usr/lib/jvm/java-7-sun/bin/jconsole 63 --slave /usr/share/man/man1/jconsole.1 jconsole.1 /usr/lib/jvm/java-7-sun/man/man1/jconsole.1
update-alternatives --quiet --install /usr/bin/jdb jdb /usr/lib/jvm/java-7-sun/bin/jdb 63 --slave /usr/share/man/man1/jdb.1 jdb.1 /usr/lib/jvm/java-7-sun/man/man1/jdb.1
update-alternatives --quiet --install /usr/bin/jhat jhat /usr/lib/jvm/java-7-sun/bin/jhat 63 --slave /usr/share/man/man1/jhat.1 jhat.1 /usr/lib/jvm/java-7-sun/man/man1/jhat.1
update-alternatives --quiet --install /usr/bin/jinfo jinfo /usr/lib/jvm/java-7-sun/bin/jinfo 63 --slave /usr/share/man/man1/jinfo.1 jinfo.1 /usr/lib/jvm/java-7-sun/man/man1/jinfo.1
update-alternatives --quiet --install /usr/bin/jmap jmap /usr/lib/jvm/java-7-sun/bin/jmap 63 --slave /usr/share/man/man1/jmap.1 jmap.1 /usr/lib/jvm/java-7-sun/man/man1/jmap.1
update-alternatives --quiet --install /usr/bin/jps jps /usr/lib/jvm/java-7-sun/bin/jps 63 --slave /usr/share/man/man1/jps.1 jps.1 /usr/lib/jvm/java-7-sun/man/man1/jps.1
update-alternatives --quiet --install /usr/bin/jrunscript jrunscript /usr/lib/jvm/java-7-sun/bin/jrunscript 63 --slave /usr/share/man/man1/jrunscript.1 jrunscript.1 /usr/lib/jvm/java-7-sun/man/man1/jrunscript.1
update-alternatives --quiet --install /usr/bin/jsadebugd jsadebugd /usr/lib/jvm/java-7-sun/bin/jsadebugd 63 --slave /usr/share/man/man1/jsadebugd.1 jsadebugd.1 /usr/lib/jvm/java-7-sun/man/man1/jsadebugd.1
update-alternatives --quiet --install /usr/bin/jstack jstack /usr/lib/jvm/java-7-sun/bin/jstack 63 --slave /usr/share/man/man1/jstack.1 jstack.1 /usr/lib/jvm/java-7-sun/man/man1/jstack.1
update-alternatives --quiet --install /usr/bin/jstat jstat /usr/lib/jvm/java-7-sun/bin/jstat 63 --slave /usr/share/man/man1/jstat.1 jstat.1 /usr/lib/jvm/java-7-sun/man/man1/jstat.1
update-alternatives --quiet --install /usr/bin/jstatd jstatd /usr/lib/jvm/java-7-sun/bin/jstatd 63 --slave /usr/share/man/man1/jstatd.1 jstatd.1 /usr/lib/jvm/java-7-sun/man/man1/jstatd.1
update-alternatives --quiet --install /usr/bin/native2ascii native2ascii /usr/lib/jvm/java-7-sun/bin/native2ascii 63 --slave /usr/share/man/man1/native2ascii.1 native2ascii.1 /usr/lib/jvm/java-7-sun/man/man1/native2ascii.1
update-alternatives --quiet --install /usr/bin/rmic rmic /usr/lib/jvm/java-7-sun/bin/rmic 63 --slave /usr/share/man/man1/rmic.1 rmic.1 /usr/lib/jvm/java-7-sun/man/man1/rmic.1
update-alternatives --quiet --install /usr/bin/schemagen schemagen /usr/lib/jvm/java-7-sun/bin/schemagen 63 --slave /usr/share/man/man1/schemagen.1 schemagen.1 /usr/lib/jvm/java-7-sun/man/man1/schemagen.1
update-alternatives --quiet --install /usr/bin/serialver serialver /usr/lib/jvm/java-7-sun/bin/serialver 63 --slave /usr/share/man/man1/serialver.1 serialver.1 /usr/lib/jvm/java-7-sun/man/man1/serialver.1
update-alternatives --quiet --install /usr/bin/wsgen wsgen /usr/lib/jvm/java-7-sun/bin/wsgen 63 --slave /usr/share/man/man1/wsgen.1 wsgen.1 /usr/lib/jvm/java-7-sun/man/man1/wsgen.1
update-alternatives --quiet --install /usr/bin/wsimport wsimport /usr/lib/jvm/java-7-sun/bin/wsimport 63 --slave /usr/share/man/man1/wsimport.1 wsimport.1 /usr/lib/jvm/java-7-sun/man/man1/wsimport.1
update-alternatives --quiet --install /usr/bin/xjc xjc /usr/lib/jvm/java-7-sun/bin/xjc 63 --slave /usr/share/man/man1/xjc.1 xjc.1 /usr/lib/jvm/java-7-sun/man/man1/xjc.1
update-alternatives --quiet --install /usr/bin/java-rmi.cgi java-rmi.cgi /usr/lib/jvm/java-7-sun/bin/java-rmi.cgi 63
update-alternatives --quiet --install /usr/bin/ControlPanel ControlPanel /usr/lib/jvm/java-7-sun/jre/bin/ControlPanel 63
update-alternatives --quiet --install /usr/bin/java java /usr/lib/jvm/java-7-sun/jre/bin/java 63
update-alternatives --quiet --install /usr/bin/java_vm java_vm /usr/lib/jvm/java-7-sun/jre/bin/java_vm 63
update-alternatives --quiet --install /usr/bin/javaws javaws /usr/lib/jvm/java-7-sun/jre/bin/javaws 63
update-alternatives --quiet --install /usr/bin/jcontrol jcontrol /usr/lib/jvm/java-7-sun/jre/bin/jcontrol 63
update-alternatives --quiet --install /usr/bin/keytool keytool /usr/lib/jvm/java-7-sun/jre/bin/keytool 63
update-alternatives --quiet --install /usr/bin/pack200 pack200 /usr/lib/jvm/java-7-sun/jre/bin/pack200 63
update-alternatives --quiet --install /usr/bin/policytool policytool /usr/lib/jvm/java-7-sun/jre/bin/policytool 63
update-alternatives --quiet --install /usr/bin/rmid rmid /usr/lib/jvm/java-7-sun/jre/bin/rmid 63
update-alternatives --quiet --install /usr/bin/rmiregistry rmiregistry /usr/lib/jvm/java-7-sun/jre/bin/rmiregistry 63
update-alternatives --quiet --install /usr/bin/unpack200 unpack200 /usr/lib/jvm/java-7-sun/jre/bin/unpack200 63
update-alternatives --quiet --install /usr/bin/orbd orbd /usr/lib/jvm/java-7-sun/jre/bin/orbd 63
update-alternatives --quiet --install /usr/bin/servertool servertool /usr/lib/jvm/java-7-sun/jre/bin/servertool 63
update-alternatives --quiet --install /usr/bin/tnameserv tnameserv /usr/lib/jvm/java-7-sun/jre/bin/tnameserv 63
update-alternatives --quiet --install /usr/bin/jexec jexec /usr/lib/jvm/java-7-sun/jre/lib/jexec 63

echo "Updating Done!"

Setelah itu simpan dengan nama java_config.sh, kemudian ketik sintaks berikut ini :

chmod +x java_config.sh
sudo ./java_config.sh

hasilnya akan seperti berikut ini :

root@Dell:~/Desktop# ./java_config 
Please Enter Your JAVA HOME (e.g /opt/jdk1.7.0) : 
/opt/jdk1.7.0_01
Creatng symlink in /usr/lib/jvm/java-7-sun..
Creating Environment JAVA_HOME..
Creating PATH Environment JAVA_HOME..
Creating CLASSPATH Environment JAVA_HOME..
Please Enter Your Java Architecture (i386/amd64) : 
i386
Do update-alternatives...
Updating Done!

Sekian dan Terima Kasih…

Referensi : http://brunoreis.com/tech/intalling-java-ubuntu-natty/

Advertisements

One thought on “Installasi Oracle JDK 7 pada Ubuntu 11.10

  1. Pingback: Instalasi Eclipse pada Ubuntu 11.10 « nunenuh

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