简体   繁体   English

启动 Android Studio 时出错:无法创建 JVM:错误代码 6

[英]Error launching Android Studio: Failed to create JVM: error code-6

I install Android Studio and run normally.我安装了 Android Studio 并正常运行。 But because it was a bit slow so I follow instructions from the website: How can you do when Android Studio was slow and It made me unable to reopen android studio though I have tried to uninstall and reinstall AS well as Java.但是因为它有点慢,所以我按照网站上的说明进行操作:当 Android Studio 运行缓慢时,您怎么办,这使我无法重新打开 android studio,尽管我已尝试卸载并重新安装 AS 和 Java。 I use Android studio 2.1, Windows 8.1, core i3, RAM 4 GB.我使用 Android studio 2.1、Windows 8.1、core i3、RAM 4 GB。

在此处输入图片说明

just go this directory:就去这个目录:

C:\\Users\\{pc name} C:\\用户\\{电脑名称}

and delete all folders starting with .AndroidStudio并删除所有以 .AndroidStudio 开头的文件夹

This solves the issue.这解决了这个问题。

请交叉检查 VMoptions filestudio64.exe.vmoptions文件或从位置 C:\\Users\\pcname.AndroidStudioX.Y 删除 studio64.exe.vmoptions

If you have updated or created studio64.exe.vmoptions which present at the location {$user}/.AndroidStudio$version.如果您更新或创建了位于 {$user}/.AndroidStudio$version 的studio64.exe.vmoptions Delete the file删除文件

You should:你应该:
- Use Windowx x64 (64 bit, because your computer has 4GB RAM). - 使用 Windowx x64(64 位,因为您的计算机有 4GB 内存)。
- Use lastest JDK (1.8 update 92, x64) for Windows - 为 Windows 使用最新的 JDK(1.8 更新 92,x64)
- Important: -重要:
Press combination keys: Windows + R or Run utility.按组合键: Windows + R运行实用程序。
type: systempropertiesadvanced类型:系统systempropertiesadvanced
在此处输入图片说明 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明

set environment variable:设置环境变量:
JAVA_HOME directory where JDK installed. JAVA_HOME JDK 安装目录。
add to PATH variable: %JAVA_HOME%\\bin添加到PATH变量: %JAVA_HOME%\\bin

删除studio64.exe.vmoptions里面的这个文件

C:\\Users\\%USER%\\.AndroidStudio{version}\\config

I have had set JAVA_HOME variable appropriately but that didn't work for me.我已经适当地设置了 JAVA_HOME 变量,但这对我不起作用。 The only thing that worked was running studio.bat file inside C:\\Program Files\\Android\\Android Studio\\bin .唯一有效的是在C:\\Program Files\\Android\\Android Studio\\bin运行studio.bat文件。 So, you can set shortcut target to point to the studio.bat file.因此,您可以将快捷方式目标设置为指向 studio.bat 文件。

NOTES:注意事项:

  • I am using OpenJDK (Installed via AdoptOpenJDK)我正在使用 OpenJDK(通过 AdoptOpenJDK 安装)
  • Android Studio version is 4.1.2 Android Studio 版本为 4.1.2

This problem can occur if there is something like a comment in the red box,so you should delete it.如果红框中有类似评论的内容,则会出现此问题,因此您应该将其删除。

https://i.stack.imgur.com/64RYL.png

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

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