Generally inorder to run Java applications we set JAVA_HOME value to java sdk directory/bin
But when this set and I try opening Android Studio it gives be an error saying JVM is not configured in your machine and doesn't open up.
If we reconfigure the JAVA_HOME to only java sdk directory path it works fine. But I wonder why this is happening??
Update: Please find image below when JAVA_HOME var is conifgured to right JDK dir, javac doesn't execute in command prompt

Thanks, Nav.
Generally inorder to run Java applications we set JAVA_HOME value to java sdk directory/bin
No. Traditionally, JAVA_HOME is set to the JRE or SDK main directory. The bin/ subdirectory might be in your PATH, though.
I have changed the values, AndroidStudio works fine but when I enter javac in command prompt it gives me error as Not Recoginzed
That is because your PATH is wrong. Your PATH needs to point to the bin/ directory within your Java SDK. My guess is that your PATH is referencing JAVA_HOME, but assuming (incorrectly) that JAVA_HOME points to that bin/ directory. Just change your PATH to ensure that it picks up the bin/ directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With