LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting Java path issues... (https://www.linuxquestions.org/questions/linux-newbie-8/setting-java-path-issues-15218/)

jmizza 02-27-2002 02:30 PM

Setting Java path issues...
 
if anyone can help, id really appreciate it. im having some problems setting the path in my /etc/profile. ive tried adding the line export PATH=$PATH:/usr/java/jdk1.3.1_02/bin to /etc/profile, but i still can't use my java compiler unless im actually in the /usr/java/jdk1.3.1_02/bin directory or i type in export PATH=$PATH:/usr/java/jdk1.3.1_02/bin each time i log on. is there something im doing wrong? ive also tried adding the directory to the end of PATH=$PATH:/usr/X11R6/bin:/usr/games:/usr/java/jdk1.3.1_02/bin as such, but each time no luck. any suggestions, cuz this is starting to piss me off a lil :(

neo77777 02-27-2002 02:37 PM

run
source /etc/profile

jmizza 02-27-2002 02:52 PM

after i run source /etc/profile, the path is recognized, btu as soon as i reboot im back at square one. what do i need to do to make the path permanent? and thanks for the quick response.

neo77777 02-27-2002 02:58 PM

Ok, I don't know why it is bitching, try to append the java executable directory into ~yourusername/.bash_profile.
Or and I have another question, what shell do you use, type
echo $SHELL
and see the output, /etc/profile works for bourne and bash shells.

jmizza 02-27-2002 03:07 PM

ive tried that too with no luck :(..... im using bash, so its not a case of me updating the wrong profile.... is there a known bug between Mandrake 8.1 and Sun's jdk1.3.2? i just dont know what im doing wrong...

neo77777 02-27-2002 03:18 PM

Sorry, I have no valid answer I ran out of options, it's definetely a bug or glitch, try to upgrade bash, I guess

neo77777 02-27-2002 03:30 PM

I just hit myself with a table edge, and it occurred to me, ~yourusername/.bashrc is a startup file
try to put the export statement there.

jmizza 02-27-2002 04:10 PM

that did the job! thanks alot, but why do you think it wouldnt work when i placed it in /etc/profile? oh well.

neo77777 02-27-2002 08:23 PM

This is supposed to be one of the startup files too, and I have no clue why it's not for you, maybe you'll need to dig deeper into your system and find out, read through man pages, and look at /etc/bashrc for any clue.
Basically man bash explains everything
Quote:

When bash is invoked as an interactive login shell, or as
a non-interactive shell with the --login option, it first
reads and executes commands from the file /etc/profile, if
that file exists. After reading that file, it looks for
~/.bash_profile, ~/.bash_login, and ~/.profile, in that
order, and reads and executes commands from the first one
that exists and is readable. The --noprofile option may
be used when the shell is started to inhibit this behav*
ior.
When an interactive shell that is not a login shell is
started, bash reads and executes commands from ~/.bashrc,
if that file exists. This may be inhibited by using the
--norc option. The --rcfile file option will force bash
to read and execute commands from file instead of
~/.bashrc.

When bash is started non-interactively, to run a shell
script, for example, it looks for the variable BASH_ENV in
the environment, expands its value if it appears there,
and uses the expanded value as the name of a file to read
and execute. Bash behaves as if the following command
were executed:
if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
but the value of the PATH variable is not used to search
for the file name.


All times are GMT -5. The time now is 06:27 AM.