IGOS Nusantara dan Sun Java: Perbedaan revisi

Dari IGNwiki
Langsung ke: navigasi, cari
Baris 30: Baris 30:
  
 
=== Mengatur path ke JDK ===
 
=== Mengatur path ke JDK ===
# export JAVA_HOME="/usr/java/jdk1.6.0_18;"
+
Setelah instalasi lakukan pengaturan variabel JAVA_HOME ke /etc/profile atau ke $HOME/.bash_profile
  
== Control Panel ==
+
Gunakan Java JDK dan JRE versi terakhir (/usr/java/latest)
# /usr/java/jre1.6.0_18/bin/ControlPanel
+
  ## export JAVA_HOME JDK/JRE ##
 
+
  export JAVA_HOME="/usr/java/latest"
  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 ...
+
  
 
== Tukar antara OpenJDK <> Sun Java ==
 
== Tukar antara OpenJDK <> Sun Java ==
 +
 +
=== java ===
 
Jalankan:
 
Jalankan:
 
  # alternatives --config java
 
  # alternatives --config java
  
  Ada 3 program yang menyediakan 'java'.
+
  Ada 5 program yang menyediakan 'java'.
 
  Perintah yang dipilih
 
  Perintah yang dipilih
 
  -----------------------------------------------
 
  -----------------------------------------------
    1          /usr/lib/jvm/jre-1.5.0-gcj/bin/java
+
1           /usr/java/jdk1.6.0_24/jre/bin/java
*+ 2           /usr/java/jdk1.6.0_18/bin/jre/java
+
    2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
     3           /usr/java/jdk1.6.0_18/bin/java
+
  + 3           /usr/java/jdk1.6.0_26/jre/bin/java
 +
    4          /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
 +
     5           /usr/java/jdk1.7.0_10/jre/bin/java
  
  Enter untuk mempertahankan pilihan[+] saat ini, atau ketik nomer yang dipilih: ...
+
  Enter untuk mempertahankan pilihan[+] saat ini, atau ketik nomer yang dipilih: 5
  
 
Pilih versi Java yang akan dipakai, lalu periksa hasilnya:
 
Pilih versi Java yang akan dipakai, lalu periksa hasilnya:
 
  # java -version
 
  # 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.7.0_10/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.7.0_10/jre/lib/i386/libnpjp2.so
 +
 +
Enter to keep the current selection[+], or type selection number: 3
 +
 +
=== libjavaplugin.so.x86_64 (64-bit) ===
 +
Jalankan:
 +
# alternatives --config libjavaplugin.so.x86_64
 +
 +
There are 3 programs which provide 'libjavaplugin.so.x86_64'.
 +
 +
  Selection    Command
 +
-----------------------------------------------
 +
*  1          /usr/java/jdk1.6.0_24/jre/lib/amd64/libnpjp2.so
 +
  + 2          /usr/java/jdk1.6.0_26/jre/lib/amd64/libnpjp2.so
 +
    3          /usr/java/jdk1.7.0_10/jre/lib/amd64/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.7.0_10/bin/javac
 +
 +
Enter to keep the current selection[+], or type selection number: 3
 +
  
 
== Uji coba ==
 
== Uji coba ==

Revisi per 27 Desember 2012 07.37

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 versi 7 dari http://java.sun.com/javase/downloads/index.jsp

Unduh berkas rpm

  • jre-7u10-linux-i586.rpm
  • jdk-7u10-linux-i586.rpm

Pasang Sun JDK atau JRE

Pasang salah satu:

# rpm -ivh jre-7u10-linux-i586.rpm

atau

# rpm -ivh jdk-7u10-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
## 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/jdk1.6.0_26/jre/bin/java
   4           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   5           /usr/java/jdk1.7.0_10/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.7.0_10/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.7.0_10/jre/lib/i386/libnpjp2.so

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

libjavaplugin.so.x86_64 (64-bit)

Jalankan:

# alternatives --config libjavaplugin.so.x86_64

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

  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/lib/amd64/libnpjp2.so
 + 2           /usr/java/jdk1.6.0_26/jre/lib/amd64/libnpjp2.so
   3           /usr/java/jdk1.7.0_10/jre/lib/amd64/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.7.0_10/bin/javac

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


Uji coba

Sumber: