LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cent OS 4.6 - need help in JDK installation (https://www.linuxquestions.org/questions/linux-software-2/cent-os-4-6-need-help-in-jdk-installation-677713/)

vikram8jp 10-20-2008 02:04 AM

Cent OS 4.6 - need help in JDK installation
 
Hello all,

I just started with Linux and CentOS 4.6. I have installed jdk1.6.0_07 on my machine. I used a binary file download, made it executable and installed it.

Code:

[root@vik ~]# cd /usr/share/java-1.6.0
[root@vik ~]# chmod +600 jdk-6u7-linux-i586.bin
[root@vik ~]# ./jdk-6u7-linux-i586.bin

After the installation, I did some testing whether the JDK is working fine or not. I tried compiling a java code, but it gave an error.

Code:

[root@vik ~]# cd /usr/share/java-1.6.0/jdk1.6.0_07/bin
[root@vik ~]# javac Hello.java
bash: javac: command not found

I checked the java version installed.

Code:

[root@vik ~]# java -version
java version "1.4.2"
gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Can anybody help me with this?

vikram8jp 10-20-2008 03:05 AM

Solved
 
Hey guys, solved this problem. Actually figured out a workaround. I wasnt able to get that working, but I had to install Netbeans as well, so downloaded the jdk+netbeans package. That did the trick.

Quote:

Originally Posted by vikram8jp (Post 3316210)
Hello all,

I just started with Linux and CentOS 4.6. I have installed jdk1.6.0_07 on my machine. I used a binary file download, made it executable and installed it.

Code:

[root@vik ~]# cd /usr/share/java-1.6.0
[root@vik ~]# chmod +600 jdk-6u7-linux-i586.bin
[root@vik ~]# ./jdk-6u7-linux-i586.bin

After the installation, I did some testing whether the JDK is working fine or not. I tried compiling a java code, but it gave an error.

Code:

[root@vik ~]# cd /usr/share/java-1.6.0/jdk1.6.0_07/bin
[root@vik ~]# javac Hello.java
bash: javac: command not found

I checked the java version installed.

Code:

[root@vik ~]# java -version
java version "1.4.2"
gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Can anybody help me with this?


sjreilly 10-20-2008 04:13 AM

Hi,

My guess is that either you don't have /usr/share/java-1.6.0/jdk1.6.0_07/bin in roots PATH environmetal variable so bash doesn't know where to find javac or you should have typed;

./javac Hello.java

in that directory.

Steve

vikram8jp 10-20-2008 07:49 PM

Hmmm.. that might have been the case Steve. The PATH variable was correctly configured but i did type the command like...
Code:

[root~vik]# javac Hello.java
Thanks for the information. I'll keep that in mind.

Quote:

Originally Posted by sjreilly (Post 3316298)
Hi,

My guess is that either you don't have /usr/share/java-1.6.0/jdk1.6.0_07/bin in roots PATH environmetal variable so bash doesn't know where to find javac or you should have typed;

./javac Hello.java

in that directory.

Steve



All times are GMT -5. The time now is 07:59 PM.