(1) Download JDK terbaru Java SE Development Kit 6 Update 25 dan pilih JDK 6 untuk linux RPM

(2) Install JDK

[[email protected] /] chmood 700 jdk-6u24-linux-i586-rpm.bin
[[email protected] /] ./jdk-6u24-linux-i586-rpm.bin

##### read terms of use #####

Do you agree to the above license terms? [yes or no]
yes
# agree

###################################

For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html

Press Enter to continue…..

Done.

(3) Setting path profile linux

[[email protected] /]#vim /etc/profile

# tambahkan baris berikut di baris paling bawah
export JAVA=/usr/java/default
export PATH=$PATH:$JAVA/bin
export CLASSPATH=.:$JAVA/jre/lib:$JAVA/lib:$JAVA/lib/tools.jar

[[[email protected] /] source /etc/profile

(4) SELESAI

Langkah selanjutnya test JDK yang telah di install.

[[email protected] home]#vim hello.java

public class hello {

public static void main(String[] args) {

System.out.println(“install JDK sukses”);

for (int i=0; i<3; i++) { System.out.println(“angka ke”+i); } } }
[[email protected] home]#javac hello.java

[[email protected] home]#java hello

install JDK sukses

angka ke1

angka ke2

angka ke3

Jika muncul “install JDK sukses” maka JDK anda telah berhasil terinstall.

๑۩۞۩๑ Ilmu untuk dipelajari, dibagi dan diamalkan ๑۩۞۩๑

0 Replies to “Install Java Development Kit (JDK) on CentOS”

Leave a Reply

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