LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-04-2007, 12:20 PM   #1
AVD_ZM
Member
 
Registered: Oct 2004
Location: HELLAS aka Greece
Distribution: K/Ubuntu Knoppel
Posts: 114

Rep: Reputation: 15
how to set path? permanently [SOLVED]


hey all,

i just installed jdk6 and i want 2 set the path permanently.
coz every time i wanna call java i have to type the entire path.

also would this help firefox to be able to call java runtime Environment (JRE)?

thanks

Last edited by AVD_ZM; 03-06-2007 at 04:42 PM.
 
Old 03-04-2007, 01:14 PM   #2
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
You can set the path environment in your .bash_profile. This only affects you and not other users. If you want a system wide path, which all users have the path, then add it to /etc/profile
 
Old 03-04-2007, 02:04 PM   #3
AVD_ZM
Member
 
Registered: Oct 2004
Location: HELLAS aka Greece
Distribution: K/Ubuntu Knoppel
Posts: 114

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Micro420
You can set the path environment in your .bash_profile. This only affects you and not other users. If you want a system wide path, which all users have the path, then add it to /etc/profile
here's whats in my bash_profile

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
-----------

so do i just add
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
PATH =${PATH}:/Java's dir
fi

thanks
 
Old 03-04-2007, 02:15 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
You need to add something that similar to below
Code:
export PATH=$PATH:/path/to/java/bin
That should go at the bottom of the page.
 
Old 03-06-2007, 01:57 PM   #5
AVD_ZM
Member
 
Registered: Oct 2004
Location: HELLAS aka Greece
Distribution: K/Ubuntu Knoppel
Posts: 114

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by reddazz
You need to add something that similar to below
Code:
export PATH=$PATH:/path/to/java/bin
That should go at the bottom of the page.
I tried export it did put it in the path,
but it was temporary, when i restarted it was gone.

i also tried editing in bash_profile

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
PATH =${PATH}:/Java's dir
fi

it didn't help. I kubuntu fresh and when i type
"$PATH" it brings me

/home/avd/mono-1.2.3.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games: No such file or directory

why do i have no such file or directory?
 
Old 03-06-2007, 04:41 PM   #6
AVD_ZM
Member
 
Registered: Oct 2004
Location: HELLAS aka Greece
Distribution: K/Ubuntu Knoppel
Posts: 114

Original Poster
Rep: Reputation: 15
YEEPEE!!!

I got it!!!

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
PATH="${PATH}":~/jdk1.6.0/bin
 
  


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
just saying - hi [ how to set path in solaris permanently ] linuxmsg Solaris / OpenSolaris 20 08-29-2014 03:23 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
How to set path permanently for a particular user Sifvion Slackware 14 10-16-2002 11:02 AM
How to set PATH permanently chandhru Linux - Newbie 3 09-24-2002 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:40 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration