LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-07-2007, 02:29 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
Question command for finding java version


hi
what is the command to find java version running in the computer.
java -version is not working.

thanks
 
Old 11-07-2007, 02:40 AM   #2
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
What do you get typing java -version?
 
Old 11-07-2007, 03:23 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
[bala@localhost eclipse]$ java -version
bash: java: command not found
 
Old 11-07-2007, 05:04 AM   #4
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
Try using the full path, when doing so, you may even get the version from the path, like here:
$ /usr/lib/jre1.6.0_01/bin/java -version
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Server VM (build 1.6.0_01-b06, mixed mode)
 
Old 11-07-2007, 07:06 AM   #5
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thank u
i have two logins .in one login java command works but in the other it does not . i have mentioned the path variables in both users .bash_profile.
 
Old 11-07-2007, 07:53 AM   #6
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
I suggest to double check $PATH for both users and make sure the path is correct and don't point to a old directory etc. If the path is correct, can both of the user actually run the program when run it with the full path?
 
Old 11-07-2007, 08:06 AM   #7
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thanks again,
i have checked the path its fine , but one thing i am intrested to understand is that when i press tab it shows all the commands (i hope i am right). in one login the command java is displayed . in the other it is not ,who actually updates the command


[bala@localhost eclipse]$ whereis java
java: /etc/java /usr/lib/java /usr/share/java


# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
export JAVA_HOME = /usr/java/jdk1.6.0_02
PATH=$JAVA_HOME/bin:$PATH
PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
~
~
~
~
~
~
~
 
  


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
command for finding java version babu198649 Linux - Newbie 3 11-07-2007 03:55 AM
finding out java version. ashlesha Linux - Newbie 4 07-13-2006 01:15 PM
finding out the java version TuxLives Mandriva 14 05-16-2006 09:55 PM
Finding Linux version r_213 Red Hat 5 01-08-2005 02:36 AM
edonkey java gui not finding java Sephiroth Linux - Software 0 03-13-2004 08:14 PM


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