LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   java -version, bash: java: command not found (https://www.linuxquestions.org/questions/programming-9/java-version-bash-java-command-not-found-629075/)

kirman 03-18-2008 08:56 PM

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!

nadroj 03-18-2008 09:30 PM

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.

kirman 03-19-2008 01:05 AM

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 :)

jay73 03-19-2008 04:00 AM

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?

kirman 03-19-2008 11:13 PM

Quote:

Originally Posted by jay73 (Post 3093549)
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.:)


All times are GMT -5. The time now is 05:51 PM.