Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

we have one java application which can work only on 1.6 and a website which works only on the latest java 1.7.

We have both java installed on our computer. But unfortunately, it cannot detect automatically which java to use while running applications.

It seems by default computer use 1.7 so when I use the application, I have to go to control panel and disable 1.7 so that computer can use 1.6.

Is there any solution to it? Like computer understands automatically 1.6 for the application and 1.7 for loading on browser.

share|improve this question
I was able to find this question over at Stackoverflow. Looks like you will have to configure the path variables and likely require the source to both the application and the website.… – Ramhound Jan 3 '14 at 13:38 that is good way I think. – avirk Jan 3 '14 at 13:40
@avirk - The program in article in question is from 2007 I guarantee you that JInitiator is not supported by Java 1.6 or 1.7 – Ramhound Jan 3 '14 at 13:50
@avirk - If you have not even confirmed it still works with the current version of Java how can you suggest it? – Ramhound Jan 3 '14 at 13:57
@avirk - I suppose thats what comments are for, I just don't think its all that responsible, to suggest a solution that you have not personally tried. – Ramhound Jan 3 '14 at 14:01

2 Answers 2

The problem is that the Java version to use is configured up in a system variable JAVA_HOME and/or by adding the relevant java.exe to the bin path and the whole system looks at those two locations.

To run using a different java version you just have to run that version.

So configure whichever version you want in your web browser as your main one.

Then create a link/batch/whatever to run the program and directly select the java you want to run. i.e.:

/java6/bin/java.exe MyApp.jar
share|improve this answer
the application is just a client running through java webstart so there is no environmental variable called java_home ..I'm not sure how to create a batch file – user1449596 Jan 24 '14 at 8:44
Running through web start I don't think you can, you have to run in whatever version of Java they have installed. – Tim B Jan 24 '14 at 9:09

If you are using Java 1.7.0_40+, you would probably be able to solve your problem by using deployment rule sets:

A new feature is being introduced in Java 7 update 40 called “Deployment Rule Set,” designed to address the issue of security and compatibility in browser applets without affecting normal back-end Java programs like Eclipse, Freemind, or Tomcat. Specifically this deployment rule set addresses two major points:

The desktop administrator’s ability to control Java version compatibility, and default choices on the end-user’s desktop. For example your users may use most recent security updates for most browser applets but still use an old Java 1.6 for that one legacy application that is no longer maintained. The end-user’s awareness of who created the application and their default interaction (ask, run, or block). By seeing the actual company or signer, the user is protected from running code by someone that they do not know. For example, I would trust “My University” or “Erik Costlow” but not “Unknown publisher” or someone else claiming to be me. For more information please review Oracle's Article on Deployment Rule Sets

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.