Launchanywhere windows error loading Java VM: 2 and 216

background
I haven’t come across such a problem for a long time. It’s all about JavaVM. Learn as you go.

LaunchAnywhere Error:
Windows error 2 occured while loading the Java VM

or

LaunchAnywhere Error:
Windows error 216 occured while loading the Java VM

English version of the error message is important, mainly when searching, the likelihood of finding the answer is greatly increased.
To solve
The first case:

LaunchAnywhere Error:
Windows error 2 occured while loading the Java VM

The reason is that after installing the Java JDK or the compact version of RE runtime environment (which is included in the former), you need to manually set the environment variables based on the version. Can’t Oracle check for environment variables at install time and set them if necessary?
Set the method
The second case:

LaunchAnywhere Error:
Windows error 216 occured while loading the Java VM

This error occurred while trying to install a 64-bit program on a 32-bit machine.

Read More: