LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-11-2016, 06:14 PM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Rep: Reputation: 28
PATH not working properly on centos7


how come despite having:
:/opt/jdk1.8.0_91/bin

at the end of my path in .bash_profile

when i type echo $PATH

my added entry isnt in path as a result javac is not found...this was working perfectly yesterday now after restarting i have this problem.

if i go PATH=$PATH:/opt/jdk1.8.0_91/bin it does fix it till i log out or the machine is restarted

thanks
 
Old 07-11-2016, 06:22 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
That shouldn't be an issue, the only thing I can think of is to verify there aren't any typos. If you put an echo or something in .bash_profile, does it get printed when you open a terminal? Remember you have to log out and back in (or SSH somewhere and SSH back) for changes to .bash_profile to take effect. Also verify your line endings didn't somehow get screwed up:
Code:
dos2unix ~/.bash_profile
 
Old 07-11-2016, 06:25 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Did you explicitly export PATH in your .bash_profile? When you change an environment variable, that changed value becomes local unless you re-export it. Or not. Looks like the current bash, at least, doesn't work that way.

Last edited by rknichols; 07-11-2016 at 06:31 PM.
 
Old 07-11-2016, 06:36 PM   #4
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Original Poster
Rep: Reputation: 28
yes export PATH is in the file under path in my .bash_profile

one thing i have noticed is when i open a terminal logged on with my username i am in / to start
printenv shows path without my java addition

dos2unix just says command not found
 
Old 07-11-2016, 06:39 PM   #5
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 257Reputation: 257Reputation: 257
I always just source the profile to update the path. But, yes, the PATH must be exported in the profile for that to work. Like so:

Code:
. .bash_profile
OR

Code:
source .bash_profile
 
Old 07-11-2016, 06:39 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
It sounds like there's a problem with your home directory. Are there permissions issues? Are any of your settings in .bashrc effective? If you just type "cd" and hit enter, where does it go and does it complain? Does your home directory sit on a separate drive that might not be mounted yet?
 
Old 07-11-2016, 07:23 PM   #7
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Original Poster
Rep: Reputation: 28
aesomemachine

does tht code go in .bash_profile

suicidaleggroll

no my home dir is local

if i go cd i get to my home direcory

was always starting in it...now im starting in /

printenv shows

HOME:user/home

yet im starting in root
 
Old 07-11-2016, 08:40 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by sigint-ninja View Post
HOME:user/home
Are you sure? That's not right at all
 
  


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
javac not working on my centos7 install sigint-ninja Linux - Newbie 2 07-10-2016 01:14 PM
usb speakers not working on centos7 sigint-ninja Linux - Newbie 2 07-09-2016 11:52 AM
[SOLVED] jdk path in centos7 Erevna Linux - Newbie 2 04-29-2016 05:38 PM
MythTv: Frontend can not properly open recordings: File path error to the master jwstric2 Linux - Software 3 06-03-2007 04:18 PM
X not working properly. MylesCLin Linux - Software 1 09-15-2004 11:46 AM


All times are GMT -5. The time now is 08:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration