LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-30-2004, 05:37 PM   #1
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Rep: Reputation: 15
Unhappy grep / which commands


Hello,

I am having problems running some Linux Commands.
A friend of mine suggested I try the following to determine if there was any JAVA RUNTIME on my server.
-----
1) grep JRE 'which dbca' --> grep: which dbca: No such file or directory

2) which java
/usr/bin/which: no java in (/u01/app/oracle/product/9.2.0.4/bin: /usr/kerberos/bin/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/oracle/bin)

3) cd /usr/local/bin --> coraenv, dbhome, oraenv

4) java -version
-bash: java: command not found

Did he send me the right commands and syntax ?
Is there anything missing in the first command: grep JRE 'which dbca' ?

PT
 
Old 08-30-2004, 05:54 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
1) Your command is just a little off. Instead of single quotes ( ' ), you need to use backticks ( ` ). On my keyboard, the backtick is located on the same key as the tilde ( ~ ). Using the backticks tells the shell to replace that text on the command line with the output of the command inside the backticks.

2) The error is telling you that there is no executable file named "java" in any of the directories listed in your PATH. The error goes on to list the contents of your PATH in parenthesis. Each directory listed is searched in order to find a matching, executable file that matches the name you gave. Each separate directory searched is separated by a colon.

3) Is this a question, or extra information? I can't quite tell...

4) This will fail for the same reason #2 failed. The system can't find an executable named java in your path.

Based on the info above, I would have to say you probably don't have java on the server, but I've never manually installed the Java Runtime Environment, so I don't know what files it needs.

Last edited by Dark_Helmet; 08-30-2004 at 05:55 PM.
 
Old 08-30-2004, 05:58 PM   #3
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
i don't know about #1 & #3 (the commands look a little off) , but based on the other two it doesn't look like you have it.
Code:
[14] sero:/usr/local/bin $ which java
/opt/java/jre/bin/java

[15] sero:/usr/local/bin $ java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
~~~~~~~~~~~~~~~~~~~~~~~~
Quote:
Originally posted by Dark_Helmet
1) Your command is just a little off.
okay, so it wasn't just me.

Last edited by synaptical; 08-30-2004 at 06:00 PM.
 
Old 08-31-2004, 08:16 AM   #4
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy tar.dz2 (file extension)

Hello,

Someone pointed out that I should download/install Java files with a tar.dz2 file extension.
I never saw a file extension like that.

How can I go about downloading and uncompressing and installing those tar.dz2 files
on my Linux Red Hat Enterprise 3 (WS) server ??


Any suggestions ?

PT
 
Old 08-31-2004, 08:18 AM   #5
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy tar.bz2 (file extension)

Hello again,

Sorry, I mean tar.bz2 file extension......

PT
 
Old 08-31-2004, 10:46 AM   #6
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
bunzip2 <filename.bz2>

or

tar -xvjf <filename.bz2>

or man bzip2

or google.
 
Old 08-31-2004, 10:55 AM   #7
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy bunzip command

Hello,

After running either the tar or bunzip commands, I should be able to type the commands
which java and java -version and get the desired results ?

Any other intermediate steps that I should take ?

PT
 
Old 08-31-2004, 04:48 PM   #8
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy bunzip2 command

Hello,

I typed:

bunzip2 jdk118_v3_glibc-2.1.3-DYNMOTIF.tar.bz2

and I got a file like

jdk118_v3_glibc-2.1.3-DYNMOTIF.tar

What next ?
When I type which java, I still get no java.........

PT
 
Old 08-31-2004, 04:53 PM   #9
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy tar

Hello,

This is what I did:

tar -xvf jdk118_v3-glibc-2.1.3-DYNMOTIF.tar


PT

PS: Now I have a sub folder jdk118_v3 under root.
Maybe I should include the folder /root/jdk118_v3 in my PATH variable in .bash_profile,
then which java would work ?
 
Old 08-31-2004, 05:13 PM   #10
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
you'd probably have to go into the new directory and install the program. and if you're going to do that, you might want to move the folder into your home directory, or a home subdirectory rather than working from /root (not a great idea to say the least -- and i'm no java expert, but the file you downloaded doesn't look like the right file anyway.)

but if you have red hat, why not just use the rpms to install java?

http://home.bredband.no/gaulyk/java/...avaredhat.html

Last edited by synaptical; 08-31-2004 at 05:14 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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grep ?? can grep us variables? DaFrEQ Linux - Software 4 09-14-2005 12:22 PM
need your help with GREP! redhatbeatswin Linux - Newbie 9 04-08-2005 03:49 PM
What does rpm -qa |grep th* (as compared to rpm -qa |grep th) display? davidas Linux - Newbie 2 03-18-2004 01:35 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:00 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
Open Source Consulting | Domain Registration