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.
[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.
[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.
[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?