LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-27-2002, 02:30 PM   #1
jmizza
LQ Newbie
 
Registered: Feb 2002
Posts: 4

Rep: Reputation: 0
Unhappy 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
 
Old 02-27-2002, 02:37 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
run
source /etc/profile
 
Old 02-27-2002, 02:52 PM   #3
jmizza
LQ Newbie
 
Registered: Feb 2002
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 02-27-2002, 02:58 PM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
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.
 
Old 02-27-2002, 03:07 PM   #5
jmizza
LQ Newbie
 
Registered: Feb 2002
Posts: 4

Original Poster
Rep: Reputation: 0
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...
 
Old 02-27-2002, 03:18 PM   #6
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
Sorry, I have no valid answer I ran out of options, it's definetely a bug or glitch, try to upgrade bash, I guess
 
Old 02-27-2002, 03:30 PM   #7
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
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.
 
Old 02-27-2002, 04:10 PM   #8
jmizza
LQ Newbie
 
Registered: Feb 2002
Posts: 4

Original Poster
Rep: Reputation: 0
that did the job! thanks alot, but why do you think it wouldnt work when i placed it in /etc/profile? oh well.
 
Old 02-27-2002, 08:23 PM   #9
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
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.

Last edited by neo77777; 02-27-2002 at 08:39 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Java Path gtkmike Suse/Novell 1 05-09-2005 04:05 PM
Setting the path variable for Java Comp. lmellen Programming 1 06-27-2004 10:38 PM
Setting the PATH for Java bruce64 Linux - Software 9 09-22-2003 11:19 AM
setting path for java ahernaiz Programming 4 03-25-2003 04:30 PM
Setting Java path for root adcripps Linux - General 3 03-16-2002 02:36 PM


All times are GMT -5. The time now is 12:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration