IGOS Nusantara dan Sun Java: Perbedaan revisi

Dari IGNwiki
Langsung ke: navigasi, cari
(Ubah ke Sun JDK)
 
(18 revisi antara oleh pengguna yang sama tidak ditampilkan)
Baris 1: Baris 1:
Beberapa aplikasi berbasis web yang memakai Java tidak dapat jalan jika memakai OpenJDK, sehingga harus memasang Sun Java JDK atau JRE.
+
Beberapa aplikasi berbasis web yang memakai Java tidak dapat jalan jika memakai OpenJDK, sehingga harus memasang Sun JDK atau JRE.
  
== Unduh JDK atau JRE ==
+
== Unduh Sun JDK atau JRE ==
Unduh Sun Java JDK atau JRE versi 6 Update 18. dari http://java.sun.com/javase/downloads/index.jsp
+
Unduh Sun JDK atau JRE dari http://java.sun.com/javase/downloads/index.jsp
  
Unduh berkas rpm.bin
+
Panduan berikut untuk Sun Java versi 8 update 25.  
* jre-6u18-linux-i586-rpm.bin ukuran 20.505.673 byte
+
32bit
* jdk-6u18-linux-i586-rpm.bin ukuran 80.314.190 byte
+
* jre-8u25-linux-i586.rpm
 +
* jdk-8u25-linux-i586.rpm
  
== Pasang Sun JRE ==
+
64bit
Misal berkas disimpan pada direktori /tmp
+
* jre-8u25-linux-x64.rpm
# cd /tmp
+
* jdk-8u25-linux-x64.rpm
# chmod 755 jre-6u18-linux-i586-rpm.bin
+
 
  # ls -l jre*
+
Untuk versi Sun Java lainnya, silakan lakukan penyesuaian dengan nama berkas rpm.
  -rwxr-xr-x  1 jr  jr    20505673 Des 22 00:23 jre-6u18-linux-i586-rpm.bin
+
 
  # ./jre-6u18-linux-i586-rpm.bin
+
== Pasang Sun JDK atau JRE ==
 +
Pasang salah satu:
 +
  # rpm -ivh jre-8u25-linux-i586.rpm
 +
atau
 +
  # rpm -ivh jdk-8u25-linux-i586.rpm
  
 
=== Ubah ke Sun JRE ===
 
=== Ubah ke Sun JRE ===
 
Jika sebelumnya telah memasang OpenJDK, maka sistem harus diubah agar memakai Sun JDK, lakukan:
 
Jika sebelumnya telah memasang OpenJDK, maka sistem harus diubah agar memakai Sun JDK, lakukan:
  # alternatives --install /usr/bin/java java /usr/java/jre1.6.0_18/bin/java 20000
+
  ## java ##
  # alternatives --install /usr/bin/javaws javaws /usr/java/jre1.6.0_18/bin/javaws 20000
+
  # alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
# alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jre1.6.0_18/bin/lib/i386/libnpjp2.so 20000
+
  
/usr/java/jre1.6.0_18/bin
+
atau
 +
# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000
  
== Pasang Sun JDK ==
+
## javaws ##
Misal berkas disimpan pada direktori /tmp
+
# alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000
  # cd /tmp
+
  # chmod +x jdk-6u18-linux-i586-rpm.bin
+
  ## Java Browser (Mozilla) Plugin 32-bit ##
  # ls -l jdk*
+
  # alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so 20000
  -rwx--x--x 1 jr jr 80314190 Des 22 00:23 jdk-6u18-linux-i586-rpm.bin
+
  # ./jdk-6u18-linux-i586-rpm.bin
+
  ## Pasang javac hanya jika memasang Java Development Kit (JDK)
 +
# alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
 +
  # alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000
  
=== Ubah ke Sun JDK ===
+
=== Mengatur path ke JDK ===
Jika sebelumnya telah memasang OpenJDK, maka sistem harus diubah agar memakai Sun JDK, lakukan:
+
Setelah instalasi lakukan pengaturan variabel JAVA_HOME ke /etc/profile atau ke $HOME/.bash_profile
# alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_18/bin/java 20000
+
 
  # alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.6.0_18/bin/javaws 20000
+
Gunakan Java JDK dan JRE versi terakhir (/usr/java/latest)
# alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jdk1.6.0_18/jre/lib/i386/libnpjp2.so 20000
+
## export JAVA_HOME JDK/JRE ##
# alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_18/bin/javac 20000
+
export JAVA_HOME="/usr/java/latest"
 +
 
 +
== Tukar antara OpenJDK <> Sun Java ==
 +
 
 +
=== java ===
 +
Jalankan:
 +
  # alternatives --config java
 +
 
 +
Ada 5 program yang menyediakan 'java'.
 +
Perintah yang dipilih
 +
-----------------------------------------------
 +
*  1          /usr/java/jdk1.6.0_24/jre/bin/java
 +
    2          /usr/lib/jvm/jre-1.5.0-gcj/bin/java
 +
  + 3          /usr/java/jre1.8.0_25/bin/java
 +
    4          /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
 +
    5          /usr/java/jdk1.8.0_25/jre/bin/java
 +
 
 +
Enter untuk mempertahankan pilihan[+] saat ini, atau ketik nomer yang dipilih: 5
  
== Konfigurasi Firefox ==
+
Pilih versi Java yang akan dipakai, lalu periksa hasilnya:
 +
# java -version
  
== Konfigurasi Google Chrome ==
+
=== javaws ===
  # mkdir /opt/google/chrome/plugins
+
Jalankan:
  # cd /opt/google/chrome/plugins
+
  # alternatives --config javaws
  # ln -s /usr/local/jre1.6.0_18/lib/i386/libnpjp2.so .
+
   
atau:
+
  There are 3 programs which provide 'javaws'.
# ln -s /usr/java/jre1.6.0_18/lib/i386/libnpjp2.so /opt/google/chrome/plugins/
+
 +
  Selection    Command
 +
-----------------------------------------------
 +
*  1          /usr/java/jdk1.6.0_24/jre/bin/javaws
 +
  + 2          /usr/java/jdk1.6.0_26/jre/bin/javaws
 +
    3          /usr/java/jdk1.8.0_25/jre/bin/javaws
 +
 +
Enter to keep the current selection[+], or type selection number: 3
  
  $ google-chrome --enable-plugins %U
+
=== libjavaplugin.so (32-bit) ===
 +
Jalankan:
 +
  # alternatives --config libjavaplugin.so
 +
 +
There are 3 programs which provide 'libjavaplugin.so'.
 +
 +
  Selection    Command
 +
-----------------------------------------------
 +
*  1          /usr/java/jdk1.6.0_24/jre/lib/i386/libnpjp2.so
 +
  + 2          /usr/java/jdk1.6.0_26/jre/lib/i386/libnpjp2.so
 +
    3          /usr/java/jdk1.8.0_25/jre/lib/i386/libnpjp2.so
 +
 +
Enter to keep the current selection[+], or type selection number: 3
  
== Control Panel ==
+
=== javac ===
  # /usr/java/jre1.6.0_18/bin/ControlPanel
+
Jalankan:
 +
  # alternatives --config javac
 +
 +
There are 3 programs which provide 'javac'.
 +
 +
  Selection    Command
 +
-----------------------------------------------
 +
*  1          /usr/java/jdk1.6.0_24/bin/javac
 +
  + 2          /usr/java/jdk1.6.0_26/bin/javac
 +
    3          /usr/java/jdk1.8.0_25/bin/javac
 +
 +
Enter to keep the current selection[+], or type selection number: 3
  
Select the Java Tab
 
Click View...
 
Click Find...
 
Click Next...
 
Select /opt/java/jre1.6.0_18/
 
Click Next...
 
Click Finsh...
 
deselect the others JREs
 
Click OK...
 
Click Apply...
 
Click OK ...
 
  
 
== Uji coba ==
 
== Uji coba ==
 
* http://www.java.com/en/download/help/testvm.xml
 
* http://www.java.com/en/download/help/testvm.xml
* http://jakarta.linetest.telkom.net/
 
* http://speedtest.co.id/ip.php (pilih Speedtest Versi Java)
 
 
* http://www.javatester.org/enabled.html
 
* http://www.javatester.org/enabled.html
 
* http://www.javatester.org/version.html
 
* http://www.javatester.org/version.html
  
 
Sumber:
 
Sumber:
* http://www.if-not-true-then-false.com/2010/02/howto-install-sun-java-jdk-jre-on-fedora-centos-red-hat/
+
* http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/
 
* http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox
 
* http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox
 
* http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html
 
* http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html
 
* http://www.jonathanpritchard.com/blog/2010/01/mozilla-firefox-3-6-linux-review/
 
* http://www.jonathanpritchard.com/blog/2010/01/mozilla-firefox-3-6-linux-review/

Revisi terkini pada 24 Desember 2014 02.31

Beberapa aplikasi berbasis web yang memakai Java tidak dapat jalan jika memakai OpenJDK, sehingga harus memasang Sun JDK atau JRE.

Unduh Sun JDK atau JRE

Unduh Sun JDK atau JRE dari http://java.sun.com/javase/downloads/index.jsp

Panduan berikut untuk Sun Java versi 8 update 25. 32bit

  • jre-8u25-linux-i586.rpm
  • jdk-8u25-linux-i586.rpm

64bit

  • jre-8u25-linux-x64.rpm
  • jdk-8u25-linux-x64.rpm

Untuk versi Sun Java lainnya, silakan lakukan penyesuaian dengan nama berkas rpm.

Pasang Sun JDK atau JRE

Pasang salah satu:

# rpm -ivh jre-8u25-linux-i586.rpm

atau

# rpm -ivh jdk-8u25-linux-i586.rpm

Ubah ke Sun JRE

Jika sebelumnya telah memasang OpenJDK, maka sistem harus diubah agar memakai Sun JDK, lakukan:

## java ##
# alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000

atau

# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000
## javaws ##
# alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000

## Java Browser (Mozilla) Plugin 32-bit ##
# alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so 20000

## Pasang javac hanya jika memasang Java Development Kit (JDK)
# alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
# alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000

Mengatur path ke JDK

Setelah instalasi lakukan pengaturan variabel JAVA_HOME ke /etc/profile atau ke $HOME/.bash_profile

Gunakan Java JDK dan JRE versi terakhir (/usr/java/latest)

## export JAVA_HOME JDK/JRE ##
export JAVA_HOME="/usr/java/latest"

Tukar antara OpenJDK <> Sun Java

java

Jalankan:

# alternatives --config java
Ada 5 program yang menyediakan 'java'.
Perintah yang dipilih
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
 + 3           /usr/java/jre1.8.0_25/bin/java
   4           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   5           /usr/java/jdk1.8.0_25/jre/bin/java
Enter untuk mempertahankan pilihan[+] saat ini, atau ketik nomer yang dipilih: 5 

Pilih versi Java yang akan dipakai, lalu periksa hasilnya:

# java -version

javaws

Jalankan:

# alternatives --config javaws

There are 3 programs which provide 'javaws'.

 Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/bin/javaws
 + 2           /usr/java/jdk1.6.0_26/jre/bin/javaws
   3           /usr/java/jdk1.8.0_25/jre/bin/javaws

Enter to keep the current selection[+], or type selection number: 3

libjavaplugin.so (32-bit)

Jalankan:

# alternatives --config libjavaplugin.so

There are 3 programs which provide 'libjavaplugin.so'.

  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/lib/i386/libnpjp2.so
 + 2           /usr/java/jdk1.6.0_26/jre/lib/i386/libnpjp2.so
   3           /usr/java/jdk1.8.0_25/jre/lib/i386/libnpjp2.so

Enter to keep the current selection[+], or type selection number: 3

javac

Jalankan:

# alternatives --config javac

There are 3 programs which provide 'javac'.

  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/bin/javac
 + 2           /usr/java/jdk1.6.0_26/bin/javac
   3           /usr/java/jdk1.8.0_25/bin/javac

Enter to keep the current selection[+], or type selection number: 3


Uji coba

Sumber: