"Switch JRE" how to change JRE release quickly?

Dear All,
the problem is: on the same PC, I've to use JRE 1.3 for a web application and JRE 1.4 for another.
To use the first application I've to remove JRE 1.4, install 1.3 and reboot.
For the second, the opposite: remove JRE 1.3, install 1.4 and reboot.
I don't want to reboot the machine, I'm trying to write a script or a batch file to change the release quickly.
I tried to copy in \windows\system32 the java.exe release that i need and also change the "CurrentVersion" value in the register but is not working.
For example to configure one browser with JRE 1.3 and another with JRE 1.4 is not working.
Any idea?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can install more than one version of the JRE .. then to configure which JRE to be used (1.3 or 1.4), you should be able to just alter the PATH variable..
For example, say you've installed like so:

   JRE 1.3
   JRE 1.4

To then change the PATH variable, so that it uses JRE 1.3, you put all directories within the PATH variable, that point to 1.3, *before* 1.4.

So, if your PATH variable consists of:


Then that would result in 1.4 being used... so, to make 1.3 used instead, you would change it to this:



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
>>For example to configure one browser with JRE 1.3 and another with JRE 1.4 is not working.

Did you try configuring this via the plugin's control panel applet?
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Mayank SPrincipal TechnologistCommented:
Are you using the same server for both web-applications? Some servers allow you to set the appropriate version of each web-application that runs under them, so you really don't need to worry about the version of JRE.
keep on interactivemind's approach.

do not call java i your scripts but the complete path.

@echo off

echo "Try 1.4"
c:\java1.4\bin\java -version
echo "Try 1.3"
c:\java1.3\bin\java -version
micbaAuthor Commented:
Dear all,
as I told you I tried to change the path and also to change the key in the register but nothing. It seems that only 1 version can be active on the Pc and to change release you need to deinstall the old and install the one you need.
This is exactly the problem.
- for the website: http://application_jre13, i've to deinstall jre 1.4 and install 1.3
- for the website: http://application_jre14, i've to deinstall jre 1.3 and install 1.4

I'd like just to launch a script before to change from one application to the other.
Mayank SPrincipal TechnologistCommented:
You still have not conveyed what server you are using. I don't think that you would need re-installation, if the same server is being used for both purposes. It would be a minor tweak of environment variables or the variables of the server if it maintains its own. If you have a server with an IDE like WSAD or any other, it would be even easier for you to specify different JRE versions for different projects. And you can always keep multiple versions of JRE installed on your system - the path would decide which one to use.
then use my *.bat file and state what is the output, i could give one for solaris or linux as well...
>>It seems that only 1 version can be active on the Pc and to change release you need to deinstall the old and install the one you need.

That's not the case. The Sun plugin console specifically allows switching between installed JREs (even the Microsoft one - perish the thought) as i indicated in my comment (which *was* an unanswered question)
Also, although something of a 'black art' this can be affected by the browser's parsing of tags too, obviating the need for human intervention:

Mayank SPrincipal TechnologistCommented:
Hope you know that some servers make use of the JAVA_HOME environment variable.... changing the value of that one might also help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.