My professor asked me to create multiple JVM's in JAVA, which is a start of my final year project in volunteer computing, but I am unable to find some solution for creating JVM's in JAVA, basically I want to build a VMM (virtual machine manager). I have tried searching on it, but I found something like, creating JVM’s through command line. Can anyone tell me, from where I can start? Best Regards.
2 Answers
there's no API in the jdk to spawn an extra jvm (that i know of). having said that, you could always use ProcessBuilder to launch a java process (same as you'd use to launch any other executable)
EDIT for starting new java processes remotely you can go with some sort of ssh (or any other remote0shell library) or, if your environment is managed, you could look at stuff like puppet or chef (which are systems used to manage large groups of computers) - which could give you not only the ability to launch but also to monitor and shut down.

- 23,949
- 10
- 71
- 115
-
In addition, even if there was such an API, this wouldn't help since according to the tags this project is about distributed computing, so you would need to log in to other machines over SSH from Java, and launch JVMs on other machines. – Robin Green Nov 24 '13 at 08:30
-
I exactly want to create JVM’s from SSH in future, but I am starting my project, for now I have to build a small program for client side, which will create new process, and it will keep track of the processes eventually in future I have to migrate this VM’s as you may heard about live migration of virtual machine. – Usama Nadeem Nov 24 '13 at 08:39
-
@user3026830 - i've expanded my answer to include remote scenarios – radai Nov 24 '13 at 09:08
-
I think ProcessBuilder will help me, thanks... :) – Usama Nadeem Nov 24 '13 at 17:19
Since, according to your question tags, this project is about distributed computing, you would need to log in to other machines over SSH from your Java application, and launch JVMs on other machines.
This only covers launching - you would also need to do monitoring, and shutdown.
For SSH you can use an SSH library for Java - or just use ProcessBuilder to call the native ssh.

- 1
- 1

- 32,079
- 16
- 104
- 187
-
Yes i want do monitoring, and in future migration also. but can i start from building little programs in client side. After that in future I will make a server to comunicate with client – Usama Nadeem Nov 24 '13 at 08:43