LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sun Java (https://www.linuxquestions.org/questions/linux-software-2/sun-java-186995/)

confidential007 05-28-2004 12:22 PM

Sun Java
 
After some work, I finally managed to get Sun's J2SE 1.4.2_04 SDK installed. When I went to run Eclipse, I recieved an error that stated that a virtual machine could not be found in the ~/eclipse3.0M8/java/jre/bin directory or in the PATH.

After searching the boards, I ran across a thread that said that you should add the export statements to the /etc/rc.local script. I followed that advice and my /etc/rc.local file now reads:
Code:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initilizatoin stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
export PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
export PATH=$PATH:/usr/java/j2sdk1.4.2_04/jre/bin

I then logged out and back in. In the terminal I checked the contents of the PATH variable. The output was:
Code:

/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/X11R6/bin
Then I tryed rebooting my computer. When I checked the contents of the PATH variable, I got the exact same output. Why isn't my PATH variable being changed?

Mega Man X 05-28-2004 01:33 PM

Try making a little symbolic link instead:

ln -s /usr/java/j2sdk1.4.2_04/jre/bin /home/user/eclipse3.0M8/java/jre/

and see if that would work ;)

confidential007 05-28-2004 03:07 PM

I tryed making the symbolic link as you specified, but I kept getting an error message about the file or folder not being found. I tryed su, but was unsuccessful in that too.

I then tryed to put the PATH declerations in the profile file
Code:

USER=......
LOGIN=.....
MAIL=......
PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
PATH=$PATH:/usr/java/j2sdk1.4.2_04/jre/bin

export PATH USER LOGIN MAIL........

(The elipses (...) are included since I did not take down the full text of the file.)

Then I logged out and back in and checked PATH, but it was unchanged. I then rebooted the computer and loged in and checked PATH, but it was still unchanged.

heinblöd 05-29-2004 07:10 AM

Did you check , if your rc.profile is executable or used at system start-up.
Do you have other things in there which work??

And which file is not found ?? Maybe some directory on a partition which was not mounted ??

Ironica 05-29-2004 11:20 AM

Which distro?
When I want to add a new directory to my PATH, I edit /etc/profile, not /etc/rc.local.

confidential007 05-29-2004 05:35 PM

First, I am using FC 2. Second, I noticed that I had changed the KDE Konsole to use csh instead of bash (Stupid!). Anyway, I tried editing the csh.cshrc file by adding
Code:

setenv PATH $PATH:/usr/java/j2sdk1.4.2_04/bin
setenv PATH $PATH:/usr/java/j2sdk1.4.2_04/jre/bin

Now whenever csh is started I gat an error message in the Konsole that says that there is an illegal operator (/). I have tried using parenthesis and the semicolon at the end of the line and using quotation marks, but none of them fix the error, and if anything, create new errors.

I have tried editing /etc/profile, but it seems to have no effect.

BTW, is there an easy way to check if my fix has worked without logging out and back in again or rebooting my computer? Does just typing csh at the prompt or changing to another shell and then bask to csh work?

confidential007 05-30-2004 12:47 PM

OK, problem solved. First, I changed by default shell to bash instead of csh. Second, I added the following to the ~/.bash_profile
Code:

PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
PATH=$PATH:/usr/java/j2sdk1.4.2_04/jre/bin

I added this before the export PATH statement. Now whenever bash starts, my PATH is updated so I can use java.


All times are GMT -5. The time now is 04:20 AM.