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?
解决方案
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).