In Android Studio's Preferences
-> Appearance & Behavior
-> System Settings
-> Updates
, I tried to enable the Use secure connection
option:
But when I clicked the Apply
button, the error "Secure connection is not supported on Java 6"
showed up:
I checked the JDK location setting in Project Structure
, and it's /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
:
It seems that I'm using Java 7, not Java 6. Then why the secure connection setting complains about not supported by Java 6?
In case needed, below is the installed JDKs on my machine:
The first one 1.6.0.jdk
is from Apple, and the other 3 are from Oracle.
This problem occurs on Mac OS. The project JDK (the JDK used for compiling your code) is different from the IDE JDK (the JDK used to run the IDE)
Your project JDK is 7, but your IDE JDK is 6.
For your case, you can add an environment variable for the IDE (by Terminal) as below:
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk
Check these documents for more information:
http://tools.android.com/tech-docs/configuration/osx-jdk
http://tools.android.com/tech-docs/configuration
Happy coding!
Exporting environment variable didn't work for me. Editing plist file did.
nano /Applications/Android\ Studio.app/Contents/Info.plist
And find this line:
<key>JVMVersion</key>
<string>1.6*</string>
Change the value from 1.6* to 1.7+
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