Take the 2-minute tour ×
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. stackoverflow.com/questions/271609/… –  Ramhound Jan 3 at 13:38
    
blogs.oracle.com/stevenChan/entry/running_multiple_java_plugins that is good way I think. –  avirk Jan 3 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 at 13:50
2  
@avirk - If you have not even confirmed it still works with the current version of Java how can you suggest it? –  Ramhound Jan 3 at 13:57
1  
@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 at 14:01

1 Answer 1

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 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 at 9:09

Your Answer

 
discard

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.