• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

how to launch two JVM executing two java programs

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to launch two different JVM, each one is executing a java program. Can any one suggest me how to do this
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You just run "java" twice, with the appropriate arguments.

Or do you mean that you want two JVMs in the same process? If so, that's probably possible, but you would need to launch the JVMs using your own native code and the Java Invocation Interface.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The number of java processes you create is the number of JVM's running at that point of time.

Say I run a time consuming program from console like

java MySampleProgram

then I open my eclipse and then I start my tomcat instance.So at this point of time I have three jvm's running.one for each of the processes.

So if I investivage the current process running then I would find that there are two instances of java and one of javaw (used by eclipse).
 
Marshal
Posts: 27366
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am guessing that Arun wants to run two different versions of Java (e.g. Java 1.4.2 and Java 5). This would be done by setting the PATH variable suitably, or by hard-coding the path to the java.exe file.
 
Ranch Hand
Posts: 257
Hibernate Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Arun,

Can you give more inputs regarding your requirement?
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic