Error: Could not create the Java Virtual Machine

Apparently on some versions of Java checking the Java version will give you the following error.

root@local:~# java -v
Unrecognized option: -v
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
root@local:~#

The issue being the -v or –version options are not recognized. On newer versions of Java it is recognized.

The proper way to do it is -version with only one dash

root@local:~# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1ubuntu1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
root@local:~#

https://askubuntu.com/questions/324858/installed-jdk-by-and-have-error-could-not-create-the-java-virtual-machine

Unity Hub Failing to Launch Unity Project

While trying to launch a project in Unity I kept getting met with, nothing… Click on the project the Hub disappears and nothing happens… Tried uninstalling and reinstalling both Unity and the Unity hub.

I did receive an error similar to the following when trying to launch Unity directly.

windows\system32\msvcp120.dll is either not designed to run on windows or it contains an error

Doing some digging online shows that it has to do with the Visual C++ Redistributable runtime package which can be downloaded here

https://www.microsoft.com/en-us/download/details.aspx?id=40784

Unity was back to working normal after installing that.

More information is available at the following link.

https://forum.unity.com/threads/unity-exe-bad-image.500938/