The Windows error 2 while loading the Java VM error message is one that pops up for some users when trying to install software that relies on the Launch Anywhere Java launcher. Consequently, the users can’t install the software when that error message pops up.
We can solve the problem by checking these two steps one by one.
# Updating Java: Go to java control panel and update your java to the latest and give it a try
# Deleting Java system variable path: This problem might be solved after deleting the system variable path. To do this open Run and go to system properties by typing systempropertiesadvanced and then change/delete your path by taping on the advance tab.