The errors you've encountered—"cannot locate com/mathworks/jmi/OpaqueJavaInterface class" and "installer error: exception calling main"—are indicative of underlying problems that can arise due to various reasons. Here are some steps to help you address these issues:
Addressing the 'Cannot locate com/mathworks/jmi/OpaqueJavaInterface class' Error:
This particular error often indicates a problem with MATLAB's Java Virtual Machine (JVM) configuration or a corrupted installation. To resolve this:
- If you've previously set the 'MATLAB_JAVA' environment variable to specify a custom JVM, it might be causing conflicts. Ensure that this variable is either unset or points to a compatible Java version. For guidance on setting or unsetting this variable, refer to:
- A 'java.opts' file in MATLAB's path can influence JVM settings and potentially cause startup issues. Search your MATLAB directories for this file and temporarily remove or rename it to see if it resolves the problem.
- If the above steps don't help, your MATLAB installation might be corrupted. Consider uninstalling and then reinstalling MATLAB. Since you're encountering uninstallation issues, proceed to the next section for guidance.
Handling the 'Installer error: exception calling main' During Uninstallation:
This error can occur due to several reasons, including:
- Corrupted Installation Files, ensure that your installation files are complete and not corrupted. If in doubt, re-download the installer from MathWorks.
- Non-standard characters in your system's TEMP, TMP environment variables, or even in your username can cause this error. Verify that these variables and your username contain only standard ASCII characters.
- Installing MATLAB in a directory that already contains a different MATLAB version can lead to conflicts. Ensure that each MATLAB version is installed in its own unique directory.
For a detailed explanation and additional troubleshooting steps, refer tothe below links: