4 Replies - 9632 Views - Last Post: 12 October 2005 - 02:56 PM Rate Topic: -----

#1 abefroman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-October 05

Switching Between Java Versions

Posted 05 October 2005 - 06:12 AM

Can anyone tell me how, if you can, to switch between Sun java versions for different programs. Lets say you have Sun Java 1.4.2 that has to be used for one program, but Sun Java 1.5 needs to be used for another. Is there any way to tell a certain version to disable/enable for specific programs? Any help would greatly be appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: Switching Between Java Versions

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Switching Between Java Versions

Posted 05 October 2005 - 06:55 AM

Well, ou can tell the version by using the java.version command. When you say 'used' for a program, what exactly do you mean? Compiled with a specific version of the compiler, or run under a specific version of the runtime environment?
Was This Post Helpful? 0
  • +
  • -

#3 abefroman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-October 05

Re: Switching Between Java Versions

Posted 05 October 2005 - 07:04 AM

I mean the version of the JRE, sorry about that. Basically, I have one program that only supports JRE 1.4.2 and another that only supports JRE 1.5.
Was This Post Helpful? 0
  • +
  • -

#4 Aironex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-October 05

Re: Switching Between Java Versions

Posted 12 October 2005 - 12:31 PM

I am having the same issue. I have two different programs and they each require different versions of the JRE. Is there a way that I can have both JRE's and run both programs.
Was This Post Helpful? 0
  • +
  • -

#5 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Switching Between Java Versions

Posted 12 October 2005 - 02:56 PM

You can definitely install several versions of the JRE, so this part is not difficult. Also, different instances can run at the same time, so there is no magic here either.

To start the right vm is trickier. I think it depends on the application what approach you can use. Some ideas, but I don't know if they work, because so far I had luck with backwards compatibility (:P), anyway I am sure that I'll be corrected promptly if I am wrong:

- some stores the jvm used in an .ini ( like the Netbeans IDE) -> set this to the VM you want your app to use

- it might get the path to the jvm from the java_home environment variable -> make a .bat file that sets it to the desired path and then launches the application

- in Windows if it is started by a shortcut that has the java[w] appname command line syntax -> just edit it so that it contains the full path to the jvm.



This was about applications, but with applets I think you are more restricted, however I think installing several browsers (argh!) might help. I am pretty much sure about that IE and Firefox start a separate instance of the vm if run simultaneously - probably because they have separate plugins? - so installing different versions of the java plugins into them might solve this problem.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1