Persiapan

Unduh file jdk-8u144-linux-x64.tar.gz di www.oracle.com dan apache-maven-3.5.0-bin.tar.gz di www.maven.apache.org

  1. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  1. https://maven.apache.org/download.cgi

Langkah Pemasangan

1. Memeriksa java dan maven sudah terpasang atau belum lewat terminal

java -version

mvn -version

2. Setelah kita sudah memeriksa teryata belum terpasang maka kita memulai menyiapkan tempat pemasangan dengan membuat direktori untuk Oracle JDK kalau maven kita simpan di direktori /opt.

sudo mkdir -p /usr/lib/jvm

3. Salin dan ekstrak file yang kita unduh ke direktori yang sudah disiapkan.

cd Downloads

ls

sudo cp -r jdk-8u144-linux-x64.tar.gz /usr/lib/jvm

cd /usr/lib/jvm

ls

sudo tar xvzf jdk-8u144-linux-x64.tar.gz

Setelah di ekstrak jdk-8u144-linux-x64.tar.gz menjadi direktori jdk1.8.0_144

kembali ke maven salin dan ekstrak file apache-maven-3.5.0-bin.tar.gz ke direktori /opt

cd ..

cd Downloads

sudo cp -r jdk-8u144-linux-x64.tar.gz /opt

cd /opt

ls

sudo tar xvzf apache-maven-3.5.0-bin.tar.gz

apache-maven-3.5.0-bin.tar.gz menjadi direktori apache-maven-3.5.0

4. Membuat file java-env.sh di direktori /etc/profile.d/

cd ..

cd /etc/profile.d

sudo nano java-env.sh

java-env.sh
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_144

export M2_HOME=/opt/apache-maven-3.5.0

export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin

5. Memberi tahu system jika Oracle JDK/JRE sudah siap digunakan.

sudo update-alternatives –install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.8.0_144/bin/java” 1

sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/jvm/jdk1.8.0_144/bin/javac” 1

sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/lib/jvm/jdk1.8.0_144/bin/javaws” 1

Memberi tahu system bahwa Maven sudah siap digunakan

sudo update-alternatives –install “/usr/bin/mvn” “mvn” “/opt/apache-maven-3.5.0/bin/mvn” 1

6. Beri tahu system jika Oracle JDK/JRE adalah default java

sudo update-alternatives –set java /usr/lib/jvm/jdk1.8.0_144/bin/java

sudo update-alternatives –set javac /usr/lib/jvm/jdk1.8.0_144/bin/javac

sudo update-alternatives –set javaws /usr/lib/jvm/jdk1.8.0_144/bin/javaws

Memberi tahu system default maven

sudo update-alternatives –set mvn /opt/apache-maven-3.5.0/bin/mvn

7. Memeriksa kembali

java -version

mvn -version

Sumber :

http://panduan.blankonlinux.or.id/umum/mengganti-open-jdk-dengan-oracle-jdk-di-blankon/

https://software.endy.muhardin.com/java/persiapan-coding-java/

http://www.pintarkomputer.com/cara-mudah-install-oracle-java-jdk-di-linux-ubuntu/

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

https://maven.apache.org/download.cgi

The following two tabs change content below.

Latest posts by fed (see all)

Leave a Reply

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