LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2006, 11:12 PM   #1
chillyroll
LQ Newbie
 
Registered: Oct 2006
Posts: 25

Rep: Reputation: 15
Need to search where Java is installed...


Hello guys,
I have a system where Java 1.5.x has already been installed and Tomcat 5 has already been configured. Now I want to install another application that asks for JAVA_HOME variable. When I try to echo $JAVA_HOME, it prints blank. That means JAVA_HOME is not set. But I think Java path is set in PATH environment variable since I can invoke Java compiler from root. But I want exact Java Installation Path so that I can set JAVA_HOME.
So, how can I make a search for a Java Installation Directory? For you people reference, my PATH variable gives me:

/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

I will be thankful to you if you could help me sort out this problem.

Thanks in advance.

Last edited by chillyroll; 12-05-2006 at 11:19 PM.
 
Old 12-06-2006, 01:00 AM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
did you try 'which java' and/or 'whereis java'?
 
Old 12-06-2006, 03:00 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
locate java | grep SunJava2-1.5
may find the base directory where java installed if u have findutils installed
 
Old 12-06-2006, 03:35 PM   #4
lordtweety
Member
 
Registered: Mar 2004
Location: Sydney
Distribution: Bodhi 3.0
Posts: 88

Rep: Reputation: 15
try this:
find / -name "*java*"

That should find all your java files and folders,
remove the wildcards if you need the java binary.
 
Old 12-06-2006, 11:09 PM   #5
chillyroll
LQ Newbie
 
Registered: Oct 2006
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks guys, it worked! Actually I am new to linux so don't know these basic commands. People say that linux is great but a bit difficult for being so much Command oriented, unlike Windows which is more user friendly I STILL THINK. But learning it now.

Anyways!!! I have got some confusion, rather I want some explanation. j-ray, can u explain this command in more detail to me?

locate java | grep SunJava2-1.5


I got an error when I run this command....

Could not open database /var/lib/slocate/slocate.db

How should i tackle with this error?

Thanks again to all of you for your help.

Last edited by chillyroll; 12-06-2006 at 11:10 PM.
 
Old 12-06-2006, 11:17 PM   #6
nilecirb
LQ Newbie
 
Registered: Jul 2005
Posts: 21

Rep: Reputation: 15
Quote:
Originally Posted by chillyroll
Anyways!!! I have got some confusion, rather I want some explanation. j-ray, can u explain this command in more detail to me?

locate java | grep SunJava2-1.5


I got an error when I run this command....

Could not open database /var/lib/slocate/slocate.db
That just means that the database listing of your files is outdated. Run "sudo updatedb" and that should be fixed. Anyways, the command "locate" looks for any instance of the search phrase (in this case: java) and prints it out. By using the pipe ("|"), you're passing what's printed out to the next command ("grep SunJava2-1.5"). grep is used to limit the output to whatever you specify (in this case: anything that has SunJava2-1.5 in the filename. Hope that helps.

Last edited by nilecirb; 12-06-2006 at 11:18 PM.
 
Old 12-08-2006, 12:27 AM   #7
chillyroll
LQ Newbie
 
Registered: Oct 2006
Posts: 25

Original Poster
Rep: Reputation: 15
Hi nilecirb,
Thanks.... for explaining in detail ;-)
 
  


Reply



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
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
Any experience with Binary Search Trees Java carspidey Programming 2 03-07-2006 03:11 AM
Synaptic Package Manager shows 'java-common' and 'java-gcj-compat' as Installed. swiadek Ubuntu 3 02-12-2006 11:54 AM
Java (File Search Problem) dolvmin Linux - Software 1 03-30-2005 07:23 PM
Command line to search where's the apllication installed mikeccs Linux - Newbie 7 07-23-2004 07:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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