• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java -version how to set from 1.5 to 1.4

 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,


I have to jdk installed 1.4.2_09 and 1.5.0_05. I set up all of my environment variables to to the 1.4 version because I want to use this one, but it keeps showing me the 1.5 version when I run 'java -version'.

I would like my system not to see the 1.5 version, but also I don't want to uninstall it.

With all environment variables set to 1.4, where can I actually make the settings so 'java -version' let's me know I'm using 1.4? Is it registry entries?

I'm doing some testing involving Tomcat, Maven, and MySql. (Tomcat is set to use 1.4 using the compatibility patch.

Appriciate any help,
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perhaps if you modify your path variable to point to the right %JAVA_HOME%\bin then it would display the right version? Also, maybe two versions are registered in your path variable that triggers this conflict...
 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a good idea,

But all of my environment variables are set to my 1.4.

So I have removed all references to 1.5 in all of my environment variables including path, JAVA_HOME everything.

 
Wagner Danda Da Silva Filho
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I gess you are using Windows, right? Where is you executing the "java -version" command? In the "cmd.exe" or "command.exe"? Type "set" in the command line and look at the "PATH" variable, check if you jdk1.4 bin path is there.
 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Windows XP Professional.


Yes my path is the C:\j2sdk1.4.2_09\bin and no other java paths are set.

Thats a good test, but do you have another suggestion?
[ October 20, 2005: Message edited by: Jimmy Die ]
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you restart the computer after changing the environment variables? Sometimes this is necessary in Windows.

But...why do you want to use Java 1.4? The Java 1.5 compiler can compile to 1.4 byte code if you use the -target 1.4 command line option. Also, Java 1.5 can run 1.4 byte code. It seems to me that you don't need to have Java 1.4 installed for most situations.

Layne
 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I did restarts, Several .

I'm running software platform called Sakai (for higher education). It runs on tomcat.

Maven is used to build and re-build the platform from src. The platform is not ready for 1.5 (believe me I've tried long and hard to make it work) and I must use Maven to recompile, for this I need to have the 1.4 version set and ready for Maven to use it to perform the build...

Normally I would just do as you suggested, but Maven is a little tempermental.


I will say that I've uninstalled the jre1.5 and kept the sdk1.5. When doing this I get the version that I am looking for, but I was hoping not to have to uninstall the jre1.5 to accomplish this.
 
Ray Horn
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seems your already have a solution; but I had same issue
on old NT box; found a 'java.exe' in the c:\winnt\system32
directory which always ran the 1.5.0_04 JRE. Could have
one installed in XP system directory.
 
Norm Radder
Ranch Hand
Posts: 1011
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Win 98 the java 1.5 installation copies the java.exe and javaw.exe files to the C:\Windows folder. It also makes some changes in the registry.

To move from 1.4 to 1.5 and back:
I copy the relevant java.exe and javaw.exe files from the java installations bin\ folder to the Windows folder.

In the registry entry:
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.5"

I change currentversion from 1.4 to 1.5 or vv.
 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some good ideas,

Thanks much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic