Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 34233

Summary: Eclipse can't find program .so files under install directory
Product: [Eclipse Project] Platform Reporter: Reza Rahman <reza>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: blocker    
Priority: P3    
Version: 2.0.2   
Target Milestone: 3.0   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Reza Rahman CLA 2003-03-09 14:21:38 EST
This bug seems so clumsy I cannot help but wonder if I am doing something wrong,
but it does not appear that I am...I am trying to run Eclipse 2.0.2 on RedHat
Linux 8 under gnome. The eclipse files
are installed under /usr/local/eclipse.

When I cd into the directory and run eclipse, everything runs fine. 
However, when I cd out of this directory and try to call eclipse (for example,
from /home/root, calling usr/local/eclipse/eclipse), eclipse cannot find the .so
files under the installation directory and will not run. The same reason inhibits
gnome shortcuts (launchers) from working.

It seems the eclipse runnable "looks" for these files under "the current
directory."  As a result, invoking it from elsewhere in gnome is throwing
everything off.

Am I doing something stupid? Do I need to put the program files somewhere
specific? Do I need to define ECLIPSE_HOME or something? Or is this a bug simply
not tested for under RedHat 8.0 gnome?
Comment 1 Reza Rahman CLA 2003-03-09 14:24:51 EST
Sorry, in the example scenario above I meant /usr/local/eclipse/eclipse NOT
usr/local/eclipse/eclipse.
Comment 2 DJ Houghton CLA 2003-03-10 15:24:00 EST
Related to bug 26756.
Work-around is to cd to the directory that Eclipse is installed and then use 
the "-data myWorkspaceLocation" command-line argument.
Comment 3 Reza Rahman CLA 2003-03-10 16:18:48 EST
Are the command line options documented somewhere? How does this solve the
shortcut problem? Should I add the -data option to all shortcuts?
Comment 4 DJ Houghton CLA 2003-03-10 16:27:36 EST
dev.eclipse.org -> Projects -> The Eclipse Project -> documentation -> 
Workbench User Guide -> 2.0 Documentation -> Tasks -> Running Eclipse

I believe for now you must modify your shortcut or add the directory with the 
Eclipse libraries to your path.

We are investigating a solution to related bug 26756 but it won't be available 
for 2.1.

Comment 5 Reza Rahman CLA 2003-03-10 16:38:28 EST
Unfortunately, I have already tried to add the files to my path to no avail. It
seems Eclipse does not search the path or any other environment variable. I will
try to modify the shortcut (launcher in RH Linux 8) to say
/usr/local/eclipse/eclipse -data \home\reza. Hopefully, that will do the trick.
Do you know of a way Eclipse can be "fooled" into believing it was invoked from
its installation director using RH Linux launchers?
Comment 6 DJ Houghton CLA 2003-03-10 16:49:34 EST
Sorry, I'm not sure how to fool it.
To be honest, I use a script which passes in all the command-line args which I 
use.
Comment 7 Reza Rahman CLA 2003-03-10 16:59:31 EST
Can you please tell me how the script looks like and how you launch it?
Comment 8 DJ Houghton CLA 2003-03-10 17:11:05 EST
I do things a little differently. I run from a console and use -consoleLog so
anything written to the log file is written to the console and grabs my
attention so I can enter bug reports. In any case, here is what I use:

./eclipse -vm /home/dj/ibm131sr2/jre/bin/java -data
/home/dj/target/head/plugins/ -consoleLog -showlocation &
Comment 9 Reza Rahman CLA 2003-03-10 19:38:00 EST
As I suspected, specifying a workspace with -data does nothing to start eclipse
out of its installation directory. I still can't believe that something like
this was overlooked while developing. As far as I am concerned, this is a bug
that needs to be fixed. In the meanwhile, if I can invent a workaraound, I will
post it here...
Comment 10 Reza Rahman CLA 2003-03-10 20:46:06 EST
Here is a workaround (it is not pretty but it works):

create a script somewhere in your path like so:

cd [ECLIPSE INSTALL DIRECTORY]
./eclipse -data $PATH

Let us assume the name of this script is run-eclipse and it is granted execute
permission. If you expect this script to run eclipse, it won't work as cd
commands do not work as you expect them to in shell scripts. In order to get
things to work,  you will need to create yet another wrapper script. Here it is:

. run-eclipse (in bash and c-shell)
OR
source run-eclipse (in bourne shell)

Now, save this script somewhere in your path as eclipse. Wherever you invoke
this script from, eclipse will run as you would expect it to. You can even use
it as a RedHat Linux 8 launcher command...

Have fun!
Comment 11 Reza Rahman CLA 2003-03-28 17:09:26 EST
Was this bug solved in the new release?
Comment 12 DJ Houghton CLA 2003-03-31 08:46:08 EST
We are investigating for 2.2.
Please see bug 26756.

*** This bug has been marked as a duplicate of 26756 ***