LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-10-2004, 12:31 AM   #1
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Rep: Reputation: 15
Modifying the PATH environment variable


Hi all!

I'd like to know how can I change the value of the PATH environment variable in a way when I close the terminal it keeps the value assigned by me? I thought if I change the previous value and then export it, it would be ready to be used whenever and wherever I want (even rebooting the system). But what really happens is that it only works in the current terminal session.

And how can I add a string to the PATH of all users?

Appreciate all your help and attention!

Regards,
Brunno
 
Old 10-10-2004, 12:37 AM   #2
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
export an environment variable only sets it for that process and child-processes. One way to get it to work for ALL terminals is to export it every time. There is a file that gets run every time you open a xterm and that's the ~/.bash_profile or ~/.bashrc file. Just add your commands to set and export your PATH there.

Thought I'll rant a bit more today.... Feeling a little long winded.
eg

Code:
 # ~/.bashrc: executed by bash(1) for non-login shells.
export PATH=/somebin

Last edited by mirradric; 10-10-2004 at 12:55 AM.
 
Old 10-10-2004, 12:41 AM   #3
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
oh... for all users...
add it to /etc/profile or /etc/bash.bashrc instead
 
Old 10-10-2004, 12:52 AM   #4
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
Tks a lot, mirradric, for your so helpful info!

But and if I want to change the PATH value just by double clicking an icon in the KDE desktop. Let me make myself clear: the problem is that I would like to run the java's Eclipse IDE, so I installed the Java SDK. When I tried to start Eclipse by double clicking its icon, it shows me a message saying it was not possible to find the java sdk bin directory in the PATH.

As you can see, I am not supposed to use the xterm everytime I want to run Eclipse... or I do have to?

Tks again!

Brunno
 
Old 10-10-2004, 01:00 AM   #5
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
Have you tried exporting your path in /etc/profile? You might have to log out an log in. See if it works. Haven't used kde for a long time and never had to do custom path for kde. (i'm used to the cli...) Don't have KDE installed so can't test.
 
Old 10-10-2004, 01:02 AM   #6
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
Oh... another way i to create links to the java executables (java, javac ....) in your path (eg. /usr/local/bin ) In fact you might want to do the same for the java manpages as well.
 
Old 10-10-2004, 01:31 AM   #7
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
mirradric,

I exported the JDK bin path in /etc/profile and it works perfectly!

I also like the idea of creating links in the /usr/local/bin directory!

Tks again!!!

Brunno

Last edited by brunnopessoa; 10-10-2004 at 01:37 AM.
 
Old 10-10-2004, 11:01 AM   #8
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
Sorry, but what do you mean by saying "in fact, you might want to do the same for the java manpages", when you cited the creation of links in /usr/local/bin? The java sdk contains manpages? Could you give a tip on it? Generally, what are the names of these manpages files?

Tks!
 
Old 10-10-2004, 11:35 AM   #9
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
Yes, if I didn't remember wrongly sun's sdk come with manpages for the tools.
I meant that you can create the links for the manpages in /usr/local/man/man1 .
 
Old 10-11-2004, 10:46 PM   #10
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
Thank you very much, mirradric! I set the java man pages links and seem to be working very well!
 
Old 11-03-2004, 04:36 PM   #11
sheds
Member
 
Registered: Oct 2004
Location: Costa Rica
Distribution: Mandrake 9.1
Posts: 30

Rep: Reputation: 15
Hi there, as you can tell, i just started using linux. My disto's mandrake 9.1. Y have tried installing limewire but it tells me this:

[rafa@00e0295c9f23 Installers]$ sh ./LimeWireLinux.bin
Preparing to install...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
No Java virtual machine could be found from your PATH
environment variable. You must install a VM prior to
running this program.
[rafa@00e0295c9f23 Installers]$

Now, i have installed java and linked mozilla with java. Applets now run in my browser. I've checked it. How do i tell the limewire installer that java is installed? I've read something about the bashrc file that i had to modify in order to get java working. Here is the text inside this file:

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PATH=$PATH:/usr/java/j2sdk1.4.2_01/jre/bin:
JAVA_HOME=/usr/java/j2sdk1.4.2_01/jre/bin
export PATH
export JAVA_HOME

What am i missing? Or is this bashrc file wrong?

Last edited by sheds; 11-03-2004 at 04:38 PM.
 
Old 11-03-2004, 10:23 PM   #12
synonymy
LQ Newbie
 
Registered: Oct 2004
Location: East Bound and Down
Distribution: mdk
Posts: 7

Rep: Reputation: 0
I actually got it all working Limewire and all, but found lime to do some crazy stuff to my network, bandwidth hogging. It does it with all OS's so be careful. I can't recall how I got it to install and work sorry.
 
  


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
Modifying DISPLAY environment variable on-the-fly ktulu1115 Linux - Software 1 10-07-2005 02:18 PM
PATH environment variable moonz Red Hat 3 09-08-2005 04:10 PM
changing path environment variable iNET_boss Linux - Newbie 2 07-27-2005 04:35 PM
which path do the environment variable files reside in ycli00 Linux - General 1 03-03-2004 01:57 AM
how do I edit the $PATH environment variable in RH7.3 needamiracle Linux - Software 3 07-02-2002 09:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:20 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration