Friday, August 4, 2017

Java JDK setup

Java JDK 

download java zip file dahulu, kita boleh dapatkan yang terkini 
pada link dibawah.


kemudian, install Java JDK tersebut.

cd Downloads
~/Downloads$ cd /usr/local
/usr/local$ sudo mkdir java
/usr/local$ ls                 (sepatutnya Java akan kelihatan) kemudian...
/usr/local$ cd java
/usr/local/java$ sudo tar xzvf /home/zaki/Downloads/jdk-8u144-linux-x64.tar.gz
/usr/local/java$ ls            
jdk1.8.0_144

kemudian, install

/usr/local/java$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_144/jre/bin/java" 1
/usr/local/java$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_144/bin/javac" 1
/usr/local/java$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_144/jre/bin/javaws" 1
/usr/local/java$ sudo update-alternatives --set java /usr/local/java/jdk1.8.0_144/jre/bin/java
/usr/local/java$ sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_144/bin/javac
/usr/local/java$ sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_144/jre/bin/javaws

untuk semak...

/usr/local/java$ ls -ld /usr/bin/java*
lrwxrwxrwx 1 root root 22 Jun 31 20:41 /usr/bin/java -> /etc/alternatives/java
lrwxrwxrwx 1 root root 23 Jun 31 20:42 /usr/bin/javac -> /etc/alternatives/javac
lrwxrwxrwx 1 root root 24 Jun 31 20:42 /usr/bin/javaws -> /etc/alternatives/javaws

/usr/local/java$ ls -ld /etc/alternatives/java*
lrwxrwxrwx 1 root root 40 Aug 29 18:18 /etc/alternatives/java -> /usr/local/java/jdk1.8.0_144/jre/bin/java
lrwxrwxrwx 1 root root 37 Aug 29 18:18 /etc/alternatives/javac -> /usr/local/java/jdk1.8.0_144/bin/javac
lrwxrwxrwx 1 root root 42 Aug 29 18:19 /etc/alternatives/javaws -> /usr/local/java/jdk1.8.0_144/jre/bin/javaws

ok kita check samada jadi atau tidak,

$ java -version atau $ javac -version

akan dapat seperti gambar dibawah, jika tidak dapat, sila ulangi langkah atas semula.



















sumber rujukan : 
https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html


No comments:

Testing aprs yaesu FT2DR