Java version troubles

I have just installed

jdk-1_5_0_11-linux-i586.rpm.bin

on my linux machine. Nevertheless, when I type on a command line

java --version

I get ' java version "1.4.2" '.

What do I need to do to upgrade to java 1.5? (I have troubles executing programs with parametrized types -- they compile with -source 1.5 option, but don't execute).

Thanks a million in advance!

[407 byte] By [dxsa] at [2007-11-26 20:52:39]
# 1
You need to alter your path.Kaj
kajbja at 2007-7-10 2:18:16 > top of Java-index,Java Essentials,Java Programming...
# 2
(Or change a symbolic link if you have one)
kajbja at 2007-7-10 2:18:16 > top of Java-index,Java Essentials,Java Programming...
# 3
Thanks for replying! How do I alter my path? (Sorry, I'm a complete newbie.)
dxsa at 2007-7-10 2:18:16 > top of Java-index,Java Essentials,Java Programming...
# 4

> Thanks for replying! How do I alter my path? (Sorry,

> I'm a complete newbie.)

It's dependent on the OS that you are using, and I think it also is dependent on the shell that you are using. Google on your OS and shell and change path.

Do also check if you have a symbolic link from java to the correct version. That's often used on unix/linux based systems, but all of this is pure OS specific and doesn't involve java at all.

Kaj

kajbja at 2007-7-10 2:18:16 > top of Java-index,Java Essentials,Java Programming...
# 5

> Thanks for replying! How do I alter my path? (Sorry,

> I'm a complete newbie.)

It's an environment variable defined probably somewhere in your .bash.rc or .bash.profile files (in your home directory).

See: http://ubuntuforums.org/showthread.php?t=969

You might also need to change your JAVA_HOME variable in one of those files.

prometheuzza at 2007-7-10 2:18:16 > top of Java-index,Java Essentials,Java Programming...
# 6
Thank you guys! I figured it out. All I have to do is to change symbolic links in /usr/bin so that they point to a directory containing java 1.5.Thanks a lot for your help!
dxsa at 2007-7-10 2:18:16 > top of Java-index,Java Essentials,Java Programming...