LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 05-15-2006, 10:46 PM   #1
TuxLives
Member
 
Registered: Sep 2003
Location: Tacoma, WA
Distribution: Mandriva all the way
Posts: 145

Rep: Reputation: 15
finding out the java version


How do i find out my java version?

I saw something that said

# java --version

but it does not like it.
 
Old 05-15-2006, 11:28 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I think you have too many dashes - have you tried java -version instead?
 
Old 05-16-2006, 12:03 PM   #3
TuxLives
Member
 
Registered: Sep 2003
Location: Tacoma, WA
Distribution: Mandriva all the way
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead
I think you have too many dashes - have you tried java -version instead?
java -version
bash: java: command not found
 
Old 05-16-2006, 02:05 PM   #4
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Looks like you don't have Java installed. If you're sure you do have it installed, it must not be resident on your $PATH.
 
Old 05-16-2006, 02:06 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Code:
find / -type f -name java 2>/dev/null
 
Old 05-16-2006, 07:40 PM   #6
TuxLives
Member
 
Registered: Sep 2003
Location: Tacoma, WA
Distribution: Mandriva all the way
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead
Code:
find / -type f -name java 2>/dev/null
Here is what i got

find / -type f -name java 2>/dev/null
/usr/java/jre1.5.0_06/bin/java
/usr/java/jdk1.5.0_06/bin/java
/usr/java/jdk1.5.0_06/jre/bin/java

ANd

whereis java
java: /etc/java /usr/share/java
 
Old 05-16-2006, 07:49 PM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Then I'm guessing that running /usr/java/jdk1.5.0_06/bin/java -version will return something similar to:
Code:
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
Which one you run probably doesn't matter, although I'd expect if you're writing code you'll be interested in the stuff under /usr/java/jdk1.5.0_06. You could add environment variables to your ~/.bash_profile file like these:
Code:
export JAVA_HOME=/usr/java/jdk1.5.0_06
export PATH=$PATH:$JAVA_HOME/bin
Hope that helps...
 
Old 05-16-2006, 07:59 PM   #8
TuxLives
Member
 
Registered: Sep 2003
Location: Tacoma, WA
Distribution: Mandriva all the way
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead
Then I'm guessing that running /usr/java/jdk1.5.0_06/bin/java -version will return something similar to:
Code:
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
Which one you run probably doesn't matter, although I'd expect if you're writing code you'll be interested in the stuff under /usr/java/jdk1.5.0_06. You could add environment variables to your ~/.bash_profile file like these:
Code:
export JAVA_HOME=/usr/java/jdk1.5.0_06
export PATH=$PATH:$JAVA_HOME/bin
Hope that helps...
What I am trying to install is FREEMIND, which needs SUN or BLACKDOWN's >=1.4, but it cannot find it an fails to install.

Yes I get this returned

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
 
Old 05-16-2006, 08:37 PM   #9
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I haven't used FREEMIND, but its docs should tell you which environment variables it needs set. Modifying your path with the following should at least let the install start:
Code:
export PATH=$PATH:/usr/java/jdk1.5.0_06/bin
 
Old 05-16-2006, 08:49 PM   #10
TuxLives
Member
 
Registered: Sep 2003
Location: Tacoma, WA
Distribution: Mandriva all the way
Posts: 145

Original Poster
Rep: Reputation: 15
ok, so where do I put this information? Me new to that depth of config.

is this in bash_profile?

Last edited by TuxLives; 05-16-2006 at 08:51 PM.
 
Old 05-16-2006, 08:54 PM   #11
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Yes, if you add it to the .bash_profile file in your home directory, it will be available every time you login. You can type it into a terminal window and it will affect everything you do in that terminal window, it just won't be a permanent change.
 
Old 05-16-2006, 08:58 PM   #12
TuxLives
Member
 
Registered: Sep 2003
Location: Tacoma, WA
Distribution: Mandriva all the way
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead
Yes, if you add it to the .bash_profile file in your home directory, it will be available every time you login. You can type it into a terminal window and it will affect everything you do in that terminal window, it just won't be a permanent change.
Hmmm

here is what I have in there now

# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

so do I just add these lines, like so?

# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

export JAVA_HOME=/usr/java/jdk1.5.0_06
export PATH=$PATH:$JAVA_HOME/bin


It seems like there could be a collision with the $PATH variable
 
Old 05-16-2006, 09:09 PM   #13
TuxLives
Member
 
Registered: Sep 2003
Location: Tacoma, WA
Distribution: Mandriva all the way
Posts: 145

Original Poster
Rep: Reputation: 15
hey i took what you gave me and what I found on the freemind site and got it working.

Thanks for you help!!!
 
Old 05-16-2006, 09:46 PM   #14
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Congratulations - I'm glad it's working
 
Old 05-16-2006, 09:55 PM   #15
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
If you have several users on your system, you need to set the JAVA_HOME and its path globally. This can be done by using a script such as the one below, placing it in /etc/profile.d and making it executable.
Code:
#!/bin/sh
export JAVA_HOME=/opt/java
export MANPATH="$MANPATH:/opt/java/man"
export PATH="$PATH:/opt/java/bin:/opt/java/jre/bin"
/opt/java is where my java jdk is installed, so you would have to edit the paths so that they are the same as the ones on your machine.
 
  


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
Finding which version is running zathrus MEPIS 4 01-19-2006 09:01 AM
Finding out the version of a program purefan Linux - Software 3 02-25-2005 05:37 PM
Finding Linux version r_213 Red Hat 5 01-08-2005 02:36 AM
need help finding the right ltmodem version spiroth10 Linux - Software 1 04-13-2004 12:29 AM
edonkey java gui not finding java Sephiroth Linux - Software 0 03-13-2004 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

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