If you are trying to access JVM on Windows operation system, make sure you have the right version of JVM (32-bit or 64-bit) installed. In my case python was 64-bit and once I installed Java 64-bit, it worked without needing to specify the path or any other extra requirements.