gpt4 book ai didi

java - 最大堆大小无效 : -Xmx512m

转载 作者:行者123 更新时间:2023-12-01 09:28:39 26 4
gpt4 key购买 nike

我已经尝试了 JVM 所有可能的堆大小,但我不断收到以下异常。

Admin pc@Admin-PC MINGW64 /c/controller/opendaylight (master)
$ /c/apache-maven-3.3.9/bin/mvn clean install
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx512m

注意 - 不要将其标记为重复,因为我已尝试过此处的所有解决方案,但无法找到最终的解决方案。

编辑注释 - 添加调试信息

$ bash -x /c/apache-maven-3.3.9/bin/mvn clean install
+ '[' -z '' ']'
+ '[' -f /etc/mavenrc ']'
+ '[' -f '/c/Users/Admin pc/.mavenrc' ']'
+ cygwin=false
+ darwin=false
+ mingw=false
+ case "`uname`" in
++ uname
+ mingw=true
+ '[' -z 'C:\Program Files\Java\jdk1.7.0_80' ']'
+ '[' -z 'C:\apache-maven-3.3.9' ']'
+ false
+ true
+ '[' -n 'C:\apache-maven-3.3.9' ']'
++ cd 'C:\apache-maven-3.3.9'
++ pwd
+ M2_HOME=/c/apache-maven-3.3.9
+ '[' -n 'C:\Program Files\Java\jdk1.7.0_80' ']'
++ cd 'C:\Program Files\Java\jdk1.7.0_80'
++ pwd
+ JAVA_HOME='/c/Program Files/Java/jdk1.7.0_80'
+ '[' -z '/c/Program Files/Java/jdk1.7.0_80' ']'
+ '[' -z '' ']'
+ '[' -n '/c/Program Files/Java/jdk1.7.0_80' ']'
+ '[' -x '/c/Program Files/Java/jdk1.7.0_80/jre/sh/java' ']'
+ JAVACMD='/c/Program Files/Java/jdk1.7.0_80/bin/java'
+ '[' '!' -x '/c/Program Files/Java/jdk1.7.0_80/bin/java' ']'
+ '[' -z '/c/Program Files/Java/jdk1.7.0_80' ']'
+ CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+ false
++ find_maven_basedir
++ local basedir
++ local wdir
+++ pwd
++ basedir=/c/controller/opendaylight
+++ pwd
++ wdir=/c/controller/opendaylight
++ '[' /c/controller/opendaylight '!=' / ']'
++ '[' -d /c/controller/opendaylight/.mvn ']'
+++ cd /c/controller/opendaylight/..
+++ pwd
++ wdir=/c/controller
++ '[' /c/controller '!=' / ']'
++ '[' -d /c/controller/.mvn ']'
++ basedir=/c/controller
++ break
++ echo /c/controller
+ MAVEN_PROJECTBASEDIR=/c/controller
++ concat_lines /c/controller/.mvn/jvm.config
++ '[' -f /c/controller/.mvn/jvm.config ']'
+++ tr -s '\n' ' '
' echo '-Xmx512m
-Xmx512M -XX:MaxPermSize=256M'
+ false
+ export MAVEN_PROJECTBASEDIR
+ MAVEN_CMD_LINE_ARGS=' clean install'
+ export MAVEN_CMD_LINE_ARGS
+ exec '/c/Program Files/Java/jdk1.7.0_80/bin/java' $'-Xmx512m\r' $'\r' -Xmx512M -XX:MaxPermSize=256M -classpath /c/apache-maven-3.3.9/boot/plexus-classworlds-2.5.2.jar -Dclassworlds.conf=/c/apache-maven-3.3.9/bin/m2.conf -Dmaven.home=/c/apache-maven-3.3.9 -Dmaven.multiModuleProjectDirectory=/c/controller org.codehaus.plexus.classworlds.launcher.Launcher clean install
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx512m

最佳答案

刚刚遇到了同样的问题。

不要摆弄设置,请确保安装了 64 位版本(而不是网站默认提供的 32 位版本)。

关于java - 最大堆大小无效 : -Xmx512m,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39639711/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com