I'm running java under a Red Hat Linux 3.4.6 and I have java version 1.4.2 installed somewhere.
I've downloaded and installed the tar.gz file for java jdk7. I've gunzipped the file and also added the installed folder to the path.
The problem is that when I write java -version in the terminal it shows
java version "1.4.2"
I'm trying to run a code written in java, but I need the latest version installed.
Any help will be greatly appreciated.
UPDATE
I've run the instructions outlined in [oracle's tutorial][1] on how to set the path. It says:
For bash Shell: 1. Edit the startup file (~/ .bashrc) 2. Modify PATH variable:
PATH=/usr/local/jdk1.6.0/bin
- export PATH
- Save and close the file
- Open new Terminal window
Verify the PATH is set properly
% java -version
Now when I run
$ echo $JAVA_HOME
$ echo $PATH
eveything seems to be fine, but when I type java -version a terrible error appears:
Error dl failure on line 875
Error failed /opt/jdk1.7.0/jre/lib/i386/client/libjvm.so, because
/lib/tls/libc.so.6: version `GLIBC-2.4' not found
(required by /opt/jdk1.7.0/jre/lib/i386/client/libjvm.so)