Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Multiple JVM's on one machine.

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know its possible to install multiple JRE on a single computer.
Is there any easy way when you create an executable Jar file to specify which one you should use? Or will it always use the one the JAVA_HOME environment variable is pointing too?

Is there any simple solution to managing multiple JVM's for multiple applications? If x application needs Java 1.4 and y application needs Java 5?

Any help or links to a howto/explanation are greatly appreciated.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't specify which JRE to use inside a jar, because the jar is inspected by the running JRE - hence it will be too late.

I'm not sure, whether the standard-jars which are used are evaluated by using the JAVA_HOME variable.
As argument I tell you, that you may run a jar without having JAVA_HOME specified.

The 'java' used to run the jar will be the first 'java' found in the PATH.

For multiple applications, older ones should do well with new JREs.
Application x should run with Java 5 too.
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes sense and I know Sun has done a lot of work to make sure each release is backwards compatible with previous versions, but I know it isn't always.

I guess I always thought it would be nice if there was a mechanism for specifying. I guess writing batch/or script files that specify which version to use. Maybe I should be looking into JNLP? Looking at the Java Control Panel (at least on a windows machine), I can open a window that will list all of the Java Runtime Versions installed on the machine (along with their paths). Each different product (Full release number e.g. 1.5.0_02 or 1.4.2_04 etc) has its platform (1.5 or .14 in my case) and a checkbox for enabling (multiple platforms/products are enabled).

So obviously Sun has created a mechanism for keeping track of different Runtimes installed on a machine. Is this mechanism only available to JNLP/Webstart programs or am I assuming to much here, and isn't even available for webstart applications?
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic