Error – Could not Create the Java Virtual Machine
When using the QTP/UFT Java Add-on to launch a Java application do you receive the error message Could not Create the Java Virtual Machine?
Does this happen on only some machine? Most likely the reason for behavior has to do with the way Java is installed on your machine.
4 things to try to fix the Could not Create the Java Virtual Machine Error
1. Using the wrong version of Java for your OS is usually what causes this error. Because of this, QTP’s Java support environment variables will not have the right path for the java add-in jar files that need to be loaded. Make sure that if you have the correct JAVA version installed.
If you have an OS 32 bit make sure that you have the Java 32 bit version installed. If the OS is 64 bit make sure that the Java 64 bit version is installed. This usually effects other programs as well – for example I see similar issues when trying to start Eclipse, if I have the wrong Java version installed. Uninstall Java and install the correct version than try again.
2. Your Java add-in may not be installed properly. Try reinstalling that ass-in and see if the behavior goes away.
3. Sometime using long file name paths that include spaces can cause issue in your environment variable. Try adding quotes around the file paths.
4. Last resort is to reinstall UFT/QTP, but rather than take the default install location, specify a different install location.
Let me know if any of the above steps helps or if you have another step that helps resolve this error.