LinuxQuestions.org
Register a domain and help support LQ
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 04-20-2012, 03:17 PM   #1
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Rep: Reputation: Disabled
Questions about modifying bash_profile values, export, etc.


My end goal: be able to use jar command from any directory i choose.

I am trying to follow instructions for unzipping a war using the jar command,

Code:
mkdir -p /tmp/my_ear
cd /tmp/my_ear
jar -xvf $WEBCENTER_HOME/archive/applications/webcenter.ear

mkdir war
cd war
jar -xvf ../spaces.war

I have been googling all day how to update the ~/.bash_profile using export $PATH...

Can someone please help walk me through the correct steps to do this? I am not sure if the path should point to the JRE, the JDK or both, but more importantly I just am new to modifying the .bash_profile. I have made a couple of my own aliases for jumping to commonly used directories, but that is about it so far!

From what I have found, it looks like this will be the path I use when updating the bash_profile - how can I confirm?
Code:
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin
And finally this is how it is currently setup in my ~/.bash_profile:

Code:
PATH=$PATH:$HOME/bin
export PATH

export PATH=/u01/app/oracle/product/fmw/Oracle_WT1/instances/instance1/bin/:$PATH

Thanks,
s
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-20-2012, 03:31 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,259

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by sethbw View Post
From what I have found, it looks like this will be the path I use when updating the bash_profile - how can I confirm?
Code:
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin
Type the full path and see if it works, IE:
Code:
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/jre
If it works, then that's the right path.

Quote:
Originally Posted by sethbw View Post
And finally this is how it is currently setup in my ~/.bash_profile:

Code:
PATH=$PATH:$HOME/bin
export PATH

export PATH=/u01/app/oracle/product/fmw/Oracle_WT1/instances/instance1/bin/:$PATH
Change your PATH=$PATH:$HOME/bin line to be:
Code:
PATH=$PATH:$HOME/bin:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin
 
2 members found this post helpful.
Old 04-20-2012, 03:47 PM   #3
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
aaahhhahahahaa i love the name thanks suicidaleggroll!

SO.. it still does not work... do I need to reboot the server or re login for the updated path to work?

I did:

nano ~/.bash_profile

updated the line per your advice

exit & saved

confirmed it was changed

went back to the directory i want to unzip the jar into and tried:
jar -xvf /u01/app/oracle/product/fmw/Oracle_WC1/archives/applications/webcenter.ear

but got this error:
-bash: jar: command not found
 
Old 04-20-2012, 03:48 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,259

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
You need to either log out and back in, or source the file in order for the changes to take effect:
Code:
source ~/.bash_profile
 
1 members found this post helpful.
Old 04-20-2012, 03:51 PM   #5
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
[webcenter@mspcollab11 my_ear]$ source ~/.bash_profile
[webcenter@mspcollab11 my_ear]$ jar -xvf /u01/app/oracle/product/fmw/Oracle_WC1/archives/applications/webcenter.ear
-bash: jar: command not found
[webcenter@mspcollab11 my_ear]$

:{:{:{
 
Old 04-20-2012, 03:56 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,259

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
What's the result of "echo $PATH"?

Last edited by suicidaleggroll; 04-20-2012 at 03:57 PM.
 
1 members found this post helpful.
Old 04-20-2012, 03:58 PM   #7
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
How do I tell?


Quote:
[webcenter@mspcollab11 my_ear]$ echo $PATH
/u01/app/oracle/product/fmw/Oracle_WT1/instances/instance1/bin/:/u01/app/oracle/product/fmw/Oracle_WT1/instances/instance1/bin/:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/webcenter/bin:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin:/home/webcenter/bin:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin
[webcenter@mspcollab11 my_ear]$
echo $SHELL i get: /bin/bash
 
Old 04-20-2012, 04:01 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,259

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Well your path has been modified correctly, if the program is there it should be running it. Make sure the jar command is located there by running:

Code:
ls -l /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin

and

/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/jar
 
1 members found this post helpful.
Old 04-20-2012, 04:02 PM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,028

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
what does ls -l /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin yeild ?
 
1 members found this post helpful.
Old 04-20-2012, 04:03 PM   #10
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
would it be a file literally called "jar" in that directory?



Quote:
[webcenter@mspcollab11 my_ear]$ ls -l /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin
total 564
-rwxr-xr-x 1 root root 42248 Jun 3 2011 java
-rwxr-xr-x 1 root root 43552 Jun 3 2011 keytool
-rwxr-xr-x 1 root root 43624 Jun 3 2011 orbd
-rwxr-xr-x 1 root root 43584 Jun 3 2011 pack200
-rwxr-xr-x 1 root root 44096 Jun 3 2011 policytool
-rwxr-xr-x 1 root root 43544 Jun 3 2011 rmid
-rwxr-xr-x 1 root root 43552 Jun 3 2011 rmiregistry
-rwxr-xr-x 1 root root 43552 Jun 3 2011 servertool
-rwxr-xr-x 1 root root 43632 Jun 3 2011 tnameserv
-rwxr-xr-x 1 root root 125568 Jun 3 2011 unpack200
[webcenter@mspcollab11 my_ear]$

Last edited by sethbw; 04-20-2012 at 04:04 PM.
 
Old 04-20-2012, 04:04 PM   #11
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,259

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by sethbw View Post
would it be a file literally called "jar" in that directory?
Yes. It looks like from your "ls" that there is no jar in that directory, which is why it can't find it. I've never used any "jar" command before, but I have run into java .jar files before. Usually in those cases I run them with "java -jar file.jar". I don't know if this has anything to do with what you're trying though.

Last edited by suicidaleggroll; 04-20-2012 at 04:06 PM.
 
1 members found this post helpful.
Old 04-20-2012, 04:05 PM   #12
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Well now I just feel stupid. I guess the trick now is finding that jar! Thanks guys.

I'm trying to locate it, using locate or find, but I don't want to return a list of .jar files... and there are a lot!
 
Old 04-20-2012, 04:06 PM   #13
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Nm I used this:

find / -name jar


Found it: /u01/app/oracle/product/fmw/Oracle_WT1/jdk/bin/jar
 
Old 04-20-2012, 04:08 PM   #14
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,259

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by sethbw View Post
Nm I used this:

find / -name jar


Found it: /u01/app/oracle/product/fmw/Oracle_WT1/jdk/bin/jar
In that case, just swap out the "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin" in your PATH in ~/.bash_profile with the directory found above, source it, and then see if it works.
 
1 members found this post helpful.
Old 04-20-2012, 04:11 PM   #15
sethbw
LQ Newbie
 
Registered: Apr 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
It worked You rock!
 
  


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
.bash_profile, "-bash: export: command not found" Squall90 Slackware 9 05-16-2012 04:45 PM
[SOLVED] fstab or export options needed to write to an nfs mounted ntfs export chief427 Linux - General 2 07-21-2011 08:07 AM
Modifying the Linux IP Stack to get TTL min/max/avg values mpk_india Linux - Kernel 0 12-31-2008 05:36 AM
export line in .bash_profile causing weird environment issues in gome hradtke Linux - General 2 05-19-2007 10:44 AM


All times are GMT -5. The time now is 02:09 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