How to dissolve the error “failed to load jni shared library” while starting eclipse in linux platform ?
Someone of you might be getting fuddled of the above problem: “failed to load jni shared library in eclipse in linux.” I too had to face the problem when i try to start “eclipse java IDE” on “fedora Linux”. Then i get the above message again and again. But, finally i get around how to get over this error. In this post, i explain how i win.
The above error message includes a path which does not exist ever in our fedora machine. I strongly believe this might be the root cause of the error. I overcome the error by doing some simple steps, that i am going to explain below.
These are the steps you have to follow:
1) When you install fedora on the machine, you must not tick java platform, so there will not be any java platform exist on the machine after the installation.
2) Download a fresh java platform from here. (I downloaded jdk-7-linux-x64.rpm)
3) Install the rpm file using the command “rpm -ivh jdk-7-linux-x64.rpm”
(This will install a new java platform on your machine.)
Here, you could face another problem, where the java platform installed to? Most probably, when you install a software, it goes to /usr/local/. But here, you could not find out the jdk 1.7 in the /usr/local/ path. The platform installs to /usr/java/ folder. Why i tell these things because, you need this path for setting java home variable.
4) Set up java home variable. I myself explained how to set up this in one of my earlier post.
5) The above step may resolve your problem. You need to restart your machine to check it out. If not, you will have to configure java.conf file as well.
6) You could find a file named “java.conf” in /etc/java/ path. You will have to edit the file, since the “JVM_ROOT” variable still points to your old default jdk. So you have to change the variable path also.
No more changes have to be made on this file. You can do this from your terminal as well by typing the command vim /etc/java/java.conf and type “i” to start editing.
7) Save the file, then restart your machine. To save the file from your terminal,
a) press escape.
b) type “:“, then wq (means write and quit), then “enter”. It saves the file and returns to your old terminal.
Next time you will be astonished when you try to start eclipse IDE. It works impeccably superb.