简体   繁体   English

在不启用环境的情况下为Android Studio设置JDK位置

[英]Set JDK location for Android Studio without an Enviroment Vairable

I am running Windows 7 and just upgraded my Android Studio and it is not working anymore. 我正在运行Windows 7,并且刚刚升级了Android Studio,但它不再起作用。 I get a dialog that says it cant find the jdk. 我得到一个对话框,说它找不到jdk。 I have version .9 now. 我现在有.9版本。 I do not have admin rights so I can not edit my Enviroment Variables. 我没有管理员权限,因此无法编辑环境变量。 Is there a way I can tell Android Studio where the JDK is. 有什么办法可以告诉Android Studio JDK在哪里。 Maybe command line args? 也许命令行参数? I havent found any source that outlines if there are any. 我还没有找到任何概述任何来源的资料。

Please note that I can not run Android Studio, so I cant update it from inside the application. 请注意,我无法运行Android Studio,因此无法从应用程序内部对其进行更新。

Also, I do have Cygwin. 另外,我有Cygwin。

Since, Android Studio was working before and only broke after the update, please check the Studio shortcut you're using to launch the IDE. 由于Android Studio在更新之前就可以使用,并且只有在更新之后才能使用,因此请检查用于启动IDE的Studio快捷方式。 By default, Android Studio points it to studio64.exe . 默认情况下,Android Studio会将其指向studio64.exe If you have a 32-bit Java JDK installed use the studio.exe to launch the IDE. 如果安装了32位Java JDK,请使用studio.exe启动IDE。


If that doesn't help, see if you can create a JAVA_HOME user variable? 如果那没有帮助,请查看是否可以创建JAVA_HOME 用户变量? You maybe able to do that even though you have a limited account. 即使您的帐户数量有限,您也可以做到这一点。 If you are unable to do so, as a last resort, move/copy the JRE (not JDK) into the Android Studio install location (right next to bin ). 如果您无法执行此操作,则不得已,将JRE(不是JDK)移动/复制到Android Studio安装位置( bin旁边)。 You need to name the folder jre or jre64 depending on which launcher you use studio.exe or studio64.exe . 您需要命名该文件夹jrejre64这取决于发射使用studio.exestudio64.exe

I solved this. 我解决了 I download the Server JRE from the Oracle page. 我从Oracle页面下载了Server JRE。 I then decompressed the gzip and untared it. 然后,我解压缩了gzip并将其解压缩。 I then then added to my ~/.bashrc file in cygwin "export JAVE_HOME=". 然后,我将其添加到cygwin的〜/ .bashrc文件中“ export JAVE_HOME =“。 Studio was able to find this. Studio能够找到这个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM