How to set different java versions for different apps. on a windows PC?

1.6k views Asked by At

I have 2 different apps, one of them is a java desktop app and the other one is a c# web app. which uses java applet in order to e-sign. The problem is desktop java app requires 1.5.0_14 and on the other hand web app. requires 1.7 and higher version of java.

I installed both java 1.5 and 1.7 versions on my PC. In order to run desktop java app., I go to C:\Progra~2\Java\jre1.5.0_14\bin and run javacpl to disable 1.7 and enable 1.5. Then I make a shortcut to javaws 1.5.0_14 to my desktop and add the jnlp of this java app (http://abc/appclient/tt.jnlp) to the target of javaws shortcut. After those settings, the java desktop app. runs.

Now I needed to also run the web app which requires 1.7 java. In order to run this app. properly Java 1.5 should be disabled, 1.7 enabled on the Java Control Panel settings. Problem is when you run this web app. the settings for 1.5.0_14 break down, I mean all of the java versions become enabled in javacpl under C:\Progra~2\Java\jre1.5.0_14\bin directory. If I restart my PC, I need to reset the java versions. Is there a way to make this happen without pain in the head?

I would be so glad if you can help me.

By the way, I tried to use batch files, etc. but did not succeed. Is there a permanent solution?

UPDATED: Here is how I did it back then.

Here is what I do to solve my issue;

    Uninstall the older Java -if there is- (in my case it is 1.5.0_14 )
    install java equal/higher than 1.7 just to run e-sign on my web application

    I prepared a VBScript in order to just run the desired jre version as follows and put jre1.5.0_14, jnlp file and VBScript on the same folder and make shortcut to the VBScript to run.

    Set oShell = WScript.CreateObject("WSCript.shell") oShell.run "%comspec% /c D:\TMS\jre1.5.0_14\bin\javaws.exe D:\TMS\tt.jnlp -verbose", 1, True

Set oShell = Nothing

Best Regards.

Thanks in advance.

0

There are 0 answers