LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-18-2008, 08:56 PM   #1
kirman
LQ Newbie
 
Registered: Mar 2008
Location: Ketro-Tann-Gemolong-Sragen-Solo-Surabaya-Jakarta-Central Java-Indonesia
Distribution: openSUSE
Posts: 8

Rep: Reputation: 0
Unhappy java -version, bash: java: command not found


Hi, all.

I have some problem with java installation. When I checked my java -version, it show that:

java -version
bash: java: command not found


I used openSUSE 10.3. Can any one help me, please!
 
Old 03-18-2008, 09:30 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 58
if your referring to the actual JRE or JDK from Sun, read the instructions they give you on the page where you download it--they are usually very good. i imagine its because 'java' isnt in your $PATH. search here for topics like that, or, again, read and follow the complete directions.
 
Old 03-19-2008, 01:05 AM   #3
kirman
LQ Newbie
 
Registered: Mar 2008
Location: Ketro-Tann-Gemolong-Sragen-Solo-Surabaya-Jakarta-Central Java-Indonesia
Distribution: openSUSE
Posts: 8

Original Poster
Rep: Reputation: 0
Angry

I'm newbie about java on linux OS. I just used linux for about 2 week, so I hope you would like to guide me how to install it, please!.

Really I'm very confused how to install it. I have tried all the instruction guide, but until now I cann't do it still.

I installed java on /opt folder, when I check ls -l /usr/bin/java
it shown that lrwxrwxrwx 1 root root 20 2008-03-17 20:07 /usr/bin/java -> /opt/jdk1.6.0_05/bin. But when I check java -version, it shown

java -version
bash: java: command not found


According to the installation guide, if installation is successfull it should show the java -version that I used. But it is not. I hope any one can help me, please! And show me by good reffernce. Thanks
 
Old 03-19-2008, 04:00 AM   #4
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
export JAVA_HOME=/usr/java/jdk1.6.0_03
export J2RE_HOME=/usr/java/jdk1.6.0_03/jre
export CLASSPATH=.:$JAVA_HOME:$JAVA_HOME/lib

Put that in your .profile or .bash_profile (hidden file in your home directory). Replace the paths with the proper ones. My jdk/jre are in /usr/java, yours may be elsewhere. Log out and it should work. But why didn't you install the jdk/jre through Yast?
 
Old 03-19-2008, 11:13 PM   #5
kirman
LQ Newbie
 
Registered: Mar 2008
Location: Ketro-Tann-Gemolong-Sragen-Solo-Surabaya-Jakarta-Central Java-Indonesia
Distribution: openSUSE
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jay73 View Post
export JAVA_HOME=/usr/java/jdk1.6.0_03
export J2RE_HOME=/usr/java/jdk1.6.0_03/jre
export CLASSPATH=.:$JAVA_HOME:$JAVA_HOME/lib

Put that in your .profile or .bash_profile (hidden file in your home directory). Replace the paths with the proper ones. My jdk/jre are in /usr/java, yours may be elsewhere. Log out and it should work. But why didn't you install the jdk/jre through Yast?
Thanks, once again for your appreciation. I've found now.
 
  


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
-bash: java: command not found vinbase Linux - Newbie 1 01-01-2008 05:52 PM
java command not found???? haora Linux - Newbie 3 03-30-2005 10:27 AM
(Debian) bash: java: command not found pjpeter Linux - Newbie 3 09-25-2004 02:59 PM
bash: java: command not found pjpeter Programming 4 09-24-2004 03:02 PM
java command - "bash: java: command not found" ??? RedHat123 Programming 2 07-16-2002 11:09 PM


All times are GMT -5. The time now is 10:34 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration