Create Path Environment for Eclipse During Logon

Hello All,
First thanks for viewing my thread. I am new to linux but my question is how can I get eclipse to recognize where the Java jdk is. For weeks every time I try to get eclipse to run I have to first type:

  1. export PATH=/usr/java/jdk1.6.0_07/bin
  2. ./eclipse

In order to run eclipse. How can I get eclipse to run without having to type export PATH=/usr/java/jdk1.6.0_07/bin
first. Thanks a lot!
Dan

You may put that in your .profile file in you home directory. Actually, you should not set the path variable like that because you will then, loose reachability to all common programs. So, use the following:

export PATH=/usr/java/jdk1.6.0_07/bin:$PATH

This way, you are keeping the value of your current PATH value intact.

That answers your question.
I have another comment. I think you are installing programs in a non-standard way because that is why you need to setup these things manually. In fact, if you install Java, Eclipse etc. in the standard way, they will be installed in standard locations and you don’t have modify the default PATH variable value at all.

Hi!
First, make sure that you have Java - JDK installed. Set the JRE:
Open Eclipse (from command line with -clean parameter) > Window > Preferences - filter jre.
Here in the Installed JREs window hit the Search button. For the patch add the /usr/lib/ and hit OK.

Thanks for your reply.
I have a question for your comment. Should I be using yast an trying to access the repository to install the software instead of downloading the files directly of the website and trying to install it that way? Thanks in advance!
Dan

That depends on several factors. In general sticking to the repos has several advantages, one that the packages are generally better tailored to the distro, and another that you get automatic updates to it. However there are times when the official repo simply does not have an up-to-date version that you must have or any version at all. Sometimes you may find a contrib repo with a suitable version, but then you are trusting the maintainer to keep up to date and fix serious bugs. Generally they are good about that.

I suggest you to install java from YaST. Here is the repository for openSUSE 11.1:
Index of /repositories/Java:/packages/openSUSE_11.1.
Eclipse is another story. I’m using it very frequently and I had a lot of problems with - installed from repositories. So at the moment I’m experiencing with the manually installed version.

Ok,

I installed the java jdk and the eclipse using Yast. Everything seems to function so far. I have not really tested it too much. I usually work with windows and a little Fedora but I plan on working with this tomorrow night so if I run into problems I will post it.
I thank you again for the advice.

I am really impressed with the OpenSuse community.
I noticed there is a link to a help chat room in one of the help links as well. Very helpful.

Dan

Good to hear that it’s worked.
Keep hacking! :wink:

For some reason over the years I’ve continued to be confounded by PATH… my current ‘challenge’ is to run Hercules out of a bin directory but it complains that

./hercules: error while loading shared libraries: libherc.so: cannot open shared object file: No such file or directory

That member is in ./herc64/hercules-SVN-5345/lib/libherc.so

SO how do access it ?

export LD_LIBRARY_PATH=./herc64/hercules-SVN-5345/lib/

Well -

stan@linux-3kun:~/usr/local/herc64/hercules-SVN-5345/bin> export LD_LIBRARY_PATH=./herc64/hercules-SVN-5345/lib/

stan@linux-3kun:~/usr/local/herc64/hercules-SVN-5345/bin> ./hercules

./hercules: error while loading shared libraries: libherc.so: cannot open shared object file: No such file or directory

You are running it from the bin directory, that means, you have to specify the lib as follows: (2 dots before the path):

export LD_LIBRARY_PATH=../lib/

(Give absolute path if you running from any other directory).

Thank you very much - my problem related to the path has been resolved… but I am missing modules for the install. At least I can go forward now when I locate them.