Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误:错误:无法创建Java虚拟机_Java_Android - Fatal编程技术网

错误:错误:无法创建Java虚拟机

错误:错误:无法创建Java虚拟机,java,android,Java,Android,大家好,我在生成符号apk时发现了这个错误 Error:Error: Could not create the Java Virtual Machine. Error:Error: A fatal exception has occurred. Program will exit. Error:Invalid maximum heap size: -Xmx4g Error:The specified size exceeds the maximum representable size. 我的

大家好,我在生成符号apk时发现了这个错误

Error:Error: Could not create the Java Virtual Machine.
Error:Error: A fatal exception has occurred. Program will exit.
Error:Invalid maximum heap size: -Xmx4g
Error:The specified size exceeds the maximum representable size.
我的配置-Android Studio 3.0.1 建造#AI-171.4443003,建造于2017年11月9日 JRE:1.8.0_152-release-915-b01 amd64 JVM:JetBrains s.r.o提供的OpenJDK 64位服务器虚拟机
Windows 10.0检查项目使用的java版本。 它可能与Studio使用的不同

例如:


您使用的是64位JRE和64位android studio吗?是的,我确实使用的是64位JRE和64位android studioAndroid studio 3.0.1构建#AI-171.4443003,构建于2017年11月9日JRE:1.8.0_152-release-915-b01 amd64 JVM:JetBrains s.r.o Windows 10.0的OpenJDK 64位服务器虚拟机您的机器有多少内存?6.00 GB(可用4.96 GB)我的项目使用的是C:\ProgramFiles(x86)\Java\jdk1.8.0\u 101,因此它是一个32位:-)(因为x86)检查C:\ProgramFiles(x86)\Java\jdk1.8.0\u 101\bin\Java-versionoh so。我的系统环境也共享相同的路径。Files(x86)\Java\jdk1.8.0\u 101\bin\Java-版本是8.0.1010.13Yep,如果您没有看到类似“Java HotSpot(TM)64位服务器”的内容,则它是32位的