File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Configuring Eclipse in Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Configuring Eclipse in Linux" Watch "Configuring Eclipse in Linux" New topic

Configuring Eclipse in Linux

Paul Lusk
Ranch Hand

Joined: Aug 29, 2009
Posts: 34
Helllo Linux Users,
I am new to Linux . I have in installed Fedora 12 and am trying to configure java and eclpse. Have java running fine from my usr directory. Having problem starting Eclipse. Get message
Failed to load the JNI shared library "/usr/lib/jvm/java-1.6.0-openjdk-".
A couple of points and/orquestions regarding this error message. First , I used file browser to look for this lib file and found that my file structure is slightly different than what eclipse expects. I found the file by looking under lib/i386/client where lib is choice in same sub as bin under jre .
A question I have is regarding The significance of the /../ structure in the error message file path. What does that indicate ?
So I am wondering do I need To find a way to tell Eclipse To look where I know the file is or do I need to find a way to create the file structure Eclipse is looking for?
Does Eclipse think the file is where the error message indicates because of an environmental setting or what?
So I am open to suggestion as to best way to proceed . Thanks in advance. Paul L
Paul Lusk
Ranch Hand

Joined: Aug 29, 2009
Posts: 34
Yikes, I think I just saw a tumbleweed rolling through this forum.
Peter Johnson

Joined: May 14, 2008
Posts: 5852

I think that Eclipse is expecting the Sun JDK with the typical directory structure. Unfortunately, Linux distros often place things in "intersting" locations which is why I never rely on any distro to install anything Java related. Try downloading and installing the Oracle JDK (download the *.rmp.bin file) and see how that goes.

Another possibility is to add lines like this to the eclipse.ini file:


JBoss In Action
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Because Sun's JDK carries non-opensource license restrictions, it is not distributed with the major Linux distros. However, unlike Windows, which is still sulking because they couldn't embrace, extend and extinguish Java with J++, most modern distros do provide some sort of Java as part of the standard install. It's just not a very good implementation of Java.

As a general rule, anything involving J2EE or the Swing GUI won't work on gcj or openjdk. They're not complete implementations (although openjdk is approaching it).

So, as Peter said, it's best to download and install the JDK RPM from, er "Oracle America". Set JAVA_HOME to point to the installed JDK (/usr/java/xxxxxx), add $JAVA_HOME/bin to your PATH and you're good to go.

The problem with implementations like openjdk isn't so much with directory structure as it is with stuff that's just not (completely) implemented. Yes, the directories show up in locations specific to the OS, but the essential channels are preserved. But you do want to set a JAVA_HOME for Eclipse to reference.

An IDE is no substitute for an Intelligent Developer.
Paul Lusk
Ranch Hand

Joined: Aug 29, 2009
Posts: 34
Thanks to both Peter And Tim for your responses to my question. I did actually already install Sun/Oracle java but my java.conf file does still point to the openjdk file locations . I will change those settings and st up bash_profile to point to downloaded java file locations. Thanks again . PL
Paul Lusk
Ranch Hand

Joined: Aug 29, 2009
Posts: 34
To Anyone who has seen the following SELinux Security alert


SELinux is preventing /opt/eclipse/eclipse from making the program stack

Detailed Description:

The eclipse application attempted to make its stack executable. This is a
potential security problem. This should never ever be necessary. Stack memory is
not executable on most OSes these days and this will not change. Executable
stack memory is one of the biggest security problems. An execstack error might
in fact be most likely raised by malicious code. Applications are sometimes
coded incorrectly and request this permission. The SELinux Memory Protection
Tests ( web page explains how
to remove this requirement. If eclipse does not work and you need it to work,
you can configure SELinux temporarily to allow this access until the application
is fixed. Please file a bug report.

Allowing Access:

Sometimes a library is accidentally marked with the execstack flag, if you find
a library with this flag you can clear it with the execstack -c LIBRARY_PATH.
Then retry your application. If the app continues to not work, you can turn the
flag back on with execstack -s LIBRARY_PATH. Otherwise, if you trust eclipse to
run correctly, you can change the context of the executable to execmem_exec_t.
"chcon -t execmem_exec_t '/opt/eclipse/eclipse'" You must also change the
default file context files on the system in order to preserve them even on a
full relabel. "semanage fcontext -a -t execmem_exec_t '/opt/eclipse/eclipse'"

Fix Command:

chcon -t execmem_exec_t '/opt/eclipse/eclipse'

Ok then, My Questions are 1) How common is this situation and 2} Is the workaround mentioned a safe permanent fix ?
Thanks in advance. PL
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Was this part of your original problem or is it a new problem?

I normally run with selinux enabled except when certain software products from a 3-letter megacorporation are too rude and crude to permit otherwise.

Eclipse itself I have no problems with. You may have a plug-in that offends, though.

One solution may be to run selinux in permissive mode, but a longer-term solution would be to either evict the offending component or construct an selinux access rule that allows what you need without opening up security in general.
Paul Lusk
Ranch Hand

Joined: Aug 29, 2009
Posts: 34
Hi Tim, Thanks again for your response.
By the way, I just posted a reply to your response which now seems lost in cyberspace , so if it shows up again and sounds a lot like this post , you know why . Guess I will save this message to clipboard before sending again just in case. Problem may have to do with using quick reply rather than post reply button
Anyway to answer your question , No, the security alert did not appear while I was getting previous error about not being able to load library file in openjdk. I am now running jdk1.6.0_21
and Eclipse Helios. I believe that previous error did not let me get to the point where this security alert would come into play.
I did a google search on exexStack error and found several forum discussions .The best on on stack overflow discussing issue with Eclipse at
that actually refers to blog at
that discusses issue with Symphony ( and mentions a certain 3-letter name megacorp )
So I tried several proposed solutions including trying to clear the execstack flag , but the only thing that worked was to run
chcon -t execmem_exec_t '/opt/eclipse/eclipse'
I am running Helios as downloaded from Eclipse site ( no added plugins ) so not sure what component would be problematic. You mentioned constucting access rule . Would that be any different/better than the code line i ran which as far as I can tell basically OK's Ecllipse to make stack executable. Thanks again PL
I agree. Here's the link:
subject: Configuring Eclipse in Linux
jQuery in Action, 3rd edition