Skip to content

Konfigurasi Java di Ubuntu 10.04

January 19, 2011

Ini adalah catatan kecil saat ngoprek konfigurasi java di linux Ubuntu 10.04 karena dah seminggu bermasalah dengan koneksi ke MSSQL Server 2005 menggunakan sqljdbc.jar pakai Netbeans. Thanks to Hamdi atas bantuannya.

Jadi, ternyata di Ubuntu 10.04 sudah ada tools yang keren banget buat ngubah/update symlink path macam-macam program, namanya “update-alternatives”. Langsung saja, praktek mengubah/update java dari semula defaulnya java versi 1.6.0.20 yang terpasang di /usr/lib/jvm/java-6-openjdk/jre/bin/java akan diubah menjadi java versi 1.6.0.22 yang terpasang di /home/juwarto/jdk1.6.0_22/bin/java.

Untuk memastikan terlebih dahulu cek konfigurasi yang telah ada dengan perintah :

# which java
Akan tampil sbb :
/usr/bin/java
# sudo update-alternatives --config java
Akan tampil sbb :
Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Selanjutnya tambahkan seleksi yang baru agar bisa dipilih dengan perintah :

# sudo update-alternatives --install /usr/bin/java java /home/juwarto/jdk1.6.0_22/bin/java 64
# sudo update-alternatives --config java
Akan tampil sbb :
Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /home/juwarto/jdk1.6.0_22/bin/java         64        manual mode
  2            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  3            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode
Press enter to keep the current choice[*], or type selection number:	--> DISINI KETIKKAN ANGKA 1
Maka akan tampil sbb :
update-alternatives: using /home/juwarto/jdk1.6.0_22/bin/java to provide /usr/bin/java (java) in manual mode.
# sudo update-alternatives --config java
Akan tampil sbb :
Selection    Path                                      Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
* 1            /home/juwarto/jdk1.6.0_22/bin/java         64        manual mode
  2            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  3            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode
Press enter to keep the current choice[*], or type selection number:	--> DISINI ENTER SAJA (karena konfigurasi baru sudah berhasil)

Terakhir untuk memastikan ketikkan perintah sbb :

# which java
Akan tampil sbb :
/usr/bin/java
# java -version
Akan tampil sbb :
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode)

Semoga bermanfaat.

From → Iptek

One Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: