Hi, I'm Robinson, and I’m happy to help you today.
Usually, the error "could not create the java virtual machine" indicates that Java doesn’t have enough available memory on your system to launch the VM client. You can increase the amount of system memory Java can use on your system in the System Variables.
1-Click on Start, search for "Edit the System Environment Variables" and click on that
2-Click on the "Environment Variables"
3-Under the System Variables pane, select New
4-Set the Variable name as _JAVA_OPTIONS and set the Variable value as -Xmx1024M
5-This will adjust the allowable memory for Java to 1024Mb
6-Then click on Ok to save the changes and try to install Java again, if the problem persists try to use the offline installer and run as Administrator