LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-21-2006, 01:00 AM   #1
linux_newbee
LQ Newbie
 
Registered: Mar 2006
Location: India
Distribution: FC4
Posts: 11

Rep: Reputation: 0
Question Linux - Java ?


How do i know where is java installed on my PC ?

java -version is working for me ...

implying that i have installed it somewhere, but i am unable to locate java/bin now

Thanks in advance
 
Old 03-21-2006, 01:45 AM   #2
Baldrick65
Member
 
Registered: Aug 2003
Location: Dunedin NZ
Distribution: Mint 13 Cinnamon
Posts: 653

Rep: Reputation: 31
Try typing this in a console
Code:
whereis java
it should print out something like this
Code:
baldrick@blackadder:~> whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/include/java /usr/share/java /usr/share/man/man1/java.1.gz
That should give you a starting point.

Baldrick
 
Old 03-21-2006, 05:54 AM   #3
linux_newbee
LQ Newbie
 
Registered: Mar 2006
Location: India
Distribution: FC4
Posts: 11

Original Poster
Rep: Reputation: 0
whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java


However i couldnt find a proper java installation ( as in a folder which contained java/bin in any of these mentioned locations)

Anything else that could help me??

java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)
 
Old 03-21-2006, 06:14 AM   #4
Seagull
Member
 
Registered: Oct 2003
Location: Holland
Distribution: SuSE 10.0 SuSE 10.2
Posts: 70

Rep: Reputation: 15
Try looking at /usr/lib/java - it's probably a simlink. Follow the chain of symlinks to the end. There you should find your 'actual' installation complete with bin, include and lib directories.

Of course it may be completely different on your distro.;-)
 
Old 03-28-2006, 08:22 PM   #5
linux_newbee
LQ Newbie
 
Registered: Mar 2006
Location: India
Distribution: FC4
Posts: 11

Original Poster
Rep: Reputation: 0
This is what i found in /usr/lib.

Code:
[linuxbee@localhost ~]$ cd /usr/lib
[linuxbee@localhost lib]$ ls -lrt jav*
java-ext:
total 0

java-1.5.0:
total 0

java-1.4.2:
total 0

java-1.4.1:
total 0

java-1.4.0:
total 0

java:
total 0
Anything else that i should try
 
Old 03-29-2006, 01:05 AM   #6
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,787

Rep: Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084
If you've run updatedb, try
Code:
locate bin/java
One of them has to be it
 
Old 03-29-2006, 02:15 AM   #7
jlo_sandog
Member
 
Registered: Jul 2005
Location: USA
Distribution: F10 (x86_64)
Posts: 549

Rep: Reputation: 32
fedora comes with java-gcj. Mine is in /usr/lib/jvm folder. If you want the sun version, then you have to download it from the sun website.
 
Old 03-29-2006, 10:19 PM   #8
linux_newbee
LQ Newbie
 
Registered: Mar 2006
Location: India
Distribution: FC4
Posts: 11

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by jlo_sandog
fedora comes with java-gcj. Mine is in /usr/lib/jvm folder.
That helped !!!

Now moving on to my main problem... I am trying to install an application on my Linux box, but while trying to do so , the following error msg is displayed
"No Java virtual machine could be found from your PATH
environment variable."
I understand that this is because some Path Variables related to Java have to be set.

Can someone tell me what variables have to be set exactly ?
 
Old 03-29-2006, 11:10 PM   #9
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,787

Rep: Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084
basically /usr/lib/jvm/bin/ should be in your PATH:
Code:
PATH="$PATH:/usr/lib/jvm/bin/"
If that works then you add that line to your .bashrc file so it gets set in every shell
 
Old 03-30-2006, 08:36 PM   #10
linux_newbee
LQ Newbie
 
Registered: Mar 2006
Location: India
Distribution: FC4
Posts: 11

Original Poster
Rep: Reputation: 0
Tried this... but i am still getting the same error.

Are there any other java-related environment variables to be set ?
 
Old 03-30-2006, 11:07 PM   #11
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32
What application did you try to install ? Because some apps like Azureus require you to have Sun's Java and wont install with GCJ.
 
Old 03-30-2006, 11:12 PM   #12
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,787

Rep: Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084Reputation: 2084
Are you starting up the installation from GUI? In that case it setting variables in a shell won't affect it. Otherwise I'm not really sure, /usr/lib/jvm/bin/ has all the stuff(java, javac, appletviewer etc)? Maybe it expects a folder named java? or jre?
 
Old 03-31-2006, 02:17 AM   #13
jlo_sandog
Member
 
Registered: Jul 2005
Location: USA
Distribution: F10 (x86_64)
Posts: 549

Rep: Reputation: 32
java is already in the path on fedora. However this is java-gcj not java sun and it is very limited. You need java from sun.
 
Old 03-31-2006, 05:32 AM   #14
dr_te_z
LQ Newbie
 
Registered: Mar 2006
Location: Zoetermeer, Holland
Distribution: slackware, debian
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by Baldrick65
Try typing this in a console
Code:
whereis java
Or (even better, you'll the java actually being used)
Code:
which java
 
Old 04-05-2006, 06:13 AM   #15
linux_newbee
LQ Newbie
 
Registered: Mar 2006
Location: India
Distribution: FC4
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlo_sandog
java is already in the path on fedora. However this is java-gcj not java sun and it is very limited. You need java from sun.

Should i uninstall java-gcj before installing sun java? Or to put the question in a better way.... is it ok to unistall java-gcj .. i mean will it affect any other dependencies which come with the other apps that come along with FC ?
 
  


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
JAVA:(jwstric2) Problems in JAVA-LINUX nedian123 Programming 1 06-28-2004 04:12 PM
java in linux citrus Linux - Software 14 03-14-2004 03:05 PM
java in linux perdesiz Linux - Software 2 12-02-2003 10:17 AM
Linux and Java + Java Media Framework (JMF) perry Programming 0 11-03-2003 10:08 AM

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

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