I sometimes get this error when I run the JUnit tests.
I’m not exactly asking what the error is. I just want to know what it means when the java VM forks?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A “forked VM” is not an error (although the error you get may be related to it).
Some tools that are involved in various aspects of compilation and testing (e.g. Maven) are written in Java and use the JVM to run themselves.
If you run unit tests for your application without forking the VM, Maven will run those tests within the same VM as Maven is running. Therefore, it may be affected by certain VM-wide settings (e.g. some system properties).
To avoid side-effects due to Maven, it’s possible to run the tests in a forked VM, that is, in a completely separate VM running as a different process in the OS.
(This can apply to other tools, Maven is just an example.)
Crashing a forked VM at least allows you to come back to the other Java application that started and orchestrated these unit tests. If you were running these tests within the same VM, you would also crash the application that launched your tests (and thus get very little information in return).