启动 Minecraft 时出现“Picked up _JAVA_OPTIONS: -Xmx512M”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20986500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 05:44:21  来源:igfitidea点击:

"Picked up _JAVA_OPTIONS: -Xmx512M" error while launching Minecraft

javaminecraftlauncher

提问by Lt Royal Shrimp

I am trying to launch Minecraft with these settings:

我正在尝试使用以下设置启动 Minecraft:

-XX:MaxPermSize=512M -Xms4096M -Xmx4096M

But I get this error:

但我收到此错误:

[19:19:13 INFO]: Client> Error occurred during initialization of VM
[19:19:13 INFO]: Client> Incompatible minimum and maximum heap sizes specified
[19:19:13 INFO]: Client> Picked up _JAVA_OPTIONS: -Xmx512M
[19:19:13 ERROR]: Game ended with bad state (exit code 1)
[19:19:13 INFO]: Deleting C:\Users\Phil\AppData\Roaming\.minecraft\versions.6.4 Forge9.11.1.953.6.4-Forge9.11.1.953-natives-13645892457185
[19:19:13 INFO]: Ignoring visibility rule and showing launcher due to a game crash

I have checked, and some say its due to the Java environment settings, however, I have checked, and there are no Java arguments in the environments settings of Windows 8.1.

我查过,有人说是Java环境设置造成的,但是我查过,Windows 8.1的环境设置中没有Java参数。

回答by user2940623

On Unix specifying -Xms was giving me trouble. If you just use -Xmx there shouldn't be any problems. -XX:MaxPermSize as far as I know is not necessary.

在 Unix 上指定 -Xms 给我带来了麻烦。如果你只是使用 -Xmx 应该没有任何问题。-XX:MaxPermSize 据我所知是没有必要的。

回答by Tobias Herkula

I suspect that you have "Razor Synapse 2.0" running, stop it and it will work. That solved it for me at least.

我怀疑您正在运行“Razor Synapse 2.0”,停止它,它就会工作。那至少为我解决了。

回答by Rheimus

Commonly caused by poor programming practice, something on your computer is setting the environment variable _JAVA_OPTIONS.

通常由糟糕的编程实践引起,您的计算机上的某些内容正在设置环境变量 _JAVA_OPTIONS。

Razer has a known issue with doing this.

Razer 在执行此操作时存在一个已知问题。

You can get around it with a fairly dirty hack by setting up your own _JAVA_OPTIONS environment variable https://kb.wisc.edu/cae/page.php?id=24500

您可以通过设置自己的 _JAVA_OPTIONS 环境变量https://kb.wisc.edu/cae/page.php?id=24500来绕过它

Set the values to your desired heap sizes.

将值设置为所需的堆大小。

If you have Razer Synapse, turning it off will not always fix the problem. You may have to uninstall it or tell it to not start on system startup then restart.

如果您有 Razer Synapse,关闭它并不总是能解决问题。您可能必须卸载它或告诉它不要在系统启动时启动然后重新启动。

Updating to the latest version of synapse may fix the problem at some point in the future when Razer eventually fixes it. (23/12/2014 || 12/23/2014) Confirmation from Razer that a patch is in the works, no ETA provided.

更新到最新版本的突触可能会在未来某个时候修复该问题,届时 Razer 最终会修复该问题。(23/12/2014 || 12/23/2014) Razer 确认补丁正在开发中,未提供预计到达时间。

回答by Joeblade

Somewhere the _JAVA_OPTIONS are being set. Which overrides any commandline parameters. here's a previous answerI gave on how to override this.

某处正在设置 _JAVA_OPTIONS。这会覆盖任何命令行参数。这是我之前给出的关于如何覆盖它的答案

export _JAVA_OPTIONS="-Xmx20m";
java Test
>> Picked up _JAVA_OPTIONS: -Xmx20m
>> mem: 19601168
>> total mem: 20447232

java -Xmx123m Test
>> Picked up _JAVA_OPTIONS: -Xmx20m
>> mem: 19601320
>> total mem: 20447232

# clear java options
export _JAVA_OPTIONS=
java -Xmx123m Test
>> Picked up _JAVA_OPTIONS: 
>> mem: 121773128
>> total mem: 123731968

It might be you need to override this variable (or test if it is set) in your batch file that starts up. Alternatively (but it isn't preferred practice) you can set the variable when you start to force your settings, but then you may be causing this issue for someone else further down the line.

您可能需要在启动的批处理文件中覆盖此变量(或测试它是否已设置)。或者(但不是首选做法)您可以在开始强制设置时设置变量,但随后您可能会为其他人造成此问题。

you could create a batch that saves the value, empties the variable, calls your program and re-sets the variable

您可以创建一个批处理来保存值、清空变量、调用程序并重新设置变量

回答by Josh Miller

Goto Start Menu, type Environment Variables, click the top option. Then in both System and User variables, delete the values for _JAVA_OPTIONS from your Environment Variables.

转到开始菜单,键入环境变量,单击顶部选项。然后在系统和用户变量中,从环境变量中删除 _JAVA_OPTIONS 的值。

This video will show you how to do it: https://www.youtube.com/watch?v=JF_o8WNt3hs

该视频将向您展示如何操作https: //www.youtube.com/watch?v=JF_o8WNt3hs

Note: If System Variables are greyed out, type in System in the start menu, and then goto Advanced System Settings on the right side. This will ensure you're accessing Environment Variables as an administrator user.

注意:如果系统变量显示为灰色,请在开始菜单中输入系统,然后转到右侧的高级系统设置。这将确保您以管理员用户身份访问环境变量。

回答by niksya

Encountered same problem with android studio V2.0. Resolved using following steps:

android studio V2.0 遇到同样的问题。使用以下步骤解决:

  1. Removed _JAVA_OPTIONSfrom your Environment Variables.
  2. Edit relevant studio.vmoptionsfile specified herein order to increase IDE memory. (for me -Xms1024m -Xmx1024mworked fine.)
  3. Restart your system.
  4. Build apk now. It should work.
  1. _JAVA_OPTIONS从您的环境变量中删除。
  2. 编辑此处studio.vmoptions指定的相关文件以增加IDE 内存。(对我来说工作得很好。)-Xms1024m -Xmx1024m
  3. 重新启动系统。
  4. 立即构建 apk。它应该工作。