Thursday, January 5, 2012

Fix the Netbeans Master Password prompt on Ubuntu 64 bit

Refer: http://wiki.netbeans.org/FaqMasterPasswordDialog

I've been having this prompt for quite a while everytime I run Netbeans, and it's REALLY annoying. Googled a bit, and found out about the wiki above. So, here's what I did to solve it.

Note: for Netbeans 7, you can just disable the master password by using the options below in your netbeans.conf (this should be in your <netbeans installation path>/etc/netbeans.conf):-
-J-Dnetbeans.keyring.no.master=true

For Netbeans 6 though, you have to troubleshoot what's causing the problem. First, add this option to netbeans.conf:-
-J-Dorg.netbeans.modules.keyring.level=FINE

Then start Netbeans, and you will STILL get the master password prompt. Check the IDE log (View -> IDE Log). Look for what's causing the error. In my case, I found this in my IDE Log:
java.lang.UnsatisfiedLinkError: Unable to load library 'gnome-keyring': libgnome-keyring.so: cannot open shared object file: No such file or directory
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:145)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:188)
        at com.sun.jna.Library$Handler.(Library.java:123)
...

I tried to search fo that libgnome-keyring.so file in my Ubuntu installation:-
khairi@ubuntu:~$ locate libgnome-keyring.so
/usr/lib/libgnome-keyring.so.0
/usr/lib/libgnome-keyring.so.0.1.1
/usr/lib32/libgnome-keyring.so
/usr/lib32/libgnome-keyring.so.0
/usr/lib32/libgnome-keyring.so.0.1.1

Ahah! I'm missing that libgnome-keyring.so file in my 64 bit library. That's why Netbeans is prompting me for the master password, coz it can't find my Gnome Keyring.

This is an easy fix. Just create a soft symlink to the actual file. Here's how:-
khairi@ubuntu:~$ cd /usr/lib
khairi@ubuntu:/usr/lib$ sudo ln -s libgnome-keyring.so.0 libgnome-keyring.so
khairi@ubuntu:/usr/lib$ ls -l libgnome-keyring*
lrwxrwxrwx 1 root root     21 2012-01-05 09:06 libgnome-keyring.so -> libgnome-keyring.so.0
lrwxrwxrwx 1 root root     25 2011-10-19 09:05 libgnome-keyring.so.0 -> libgnome-keyring.so.0.1.1
-rw-r--r-- 1 root root 139144 2011-09-26 21:45 libgnome-keyring.so.0.1.1
khairi@ubuntu:/usr/lib$ ls -l ../lib32/libgnome-keyring*
lrwxrwxrwx 1 root root     21 2011-10-19 09:06 ../lib32/libgnome-keyring.so -> libgnome-keyring.so.0
lrwxrwxrwx 1 root root     25 2011-10-19 09:06 ../lib32/libgnome-keyring.so.0 -> libgnome-keyring.so.0.1.1
-rw-r--r-- 1 root root 133412 2011-09-26 21:44 ../lib32/libgnome-keyring.so.0.1.1

That should fix it.

Cheers!

0 comments:

Post a Comment

.