当不存在这样的环境变量时“拿起_JAVA_OPTIONS”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27414699/
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
"Picked up _JAVA_OPTIONS" when no such environment variable exists
提问by Derek
This issue pertains specifically to Minecraft, but it is affecting all Java programs that run on my computer.
此问题专门与 Minecraft 相关,但它会影响在我的计算机上运行的所有 Java 程序。
It would seem that something is forcibly setting a _JAVA_OPTIONS environment variable. When I run my server, I have specified to allocate 4 GB of RAM to it with
似乎有些东西强行设置了 _JAVA_OPTIONS 环境变量。当我运行我的服务器时,我指定为它分配 4 GB 的 RAM
-Xms4G -Xmx4G
in the startup batch file. However, when the server runs, It prints "Picked up _JAVA_OPTIONS: -Xms2048M -Xmx2048M" to the console, only allocating 2 GB. I have checked my system settings and there is no _JAVA_OPTIONS environment variable in the list. I do not want to add one, since that will also try to allocate 4 GB to Minecraft itself, which is unnecessary and uses too much RAM.
在启动批处理文件中。但是,当服务器运行时,它会向控制台打印“Picked up _JAVA_OPTIONS: -Xms2048M -Xmx2048M”,只分配了 2 GB。我检查了我的系统设置,列表中没有 _JAVA_OPTIONS 环境变量。我不想添加一个,因为这也会尝试为 Minecraft 本身分配 4 GB,这是不必要的并且会使用太多 RAM。
What could be causing this variable to be set? (Windows 8.1 64-bit, Java 7)
什么可能导致设置此变量?(Windows 8.1 64 位,Java 7)
采纳答案by Sophistifunk
You probably have a Razer device. Their god-forsaken software secretly adds _JAVA_OPTIONS, but only when launching games, so you won't even see it from CMD. Ideally uninstall the software, and maybe splash some holy water on your PC. Failing that, you can probably get by with shutting down Synapse and restarting minecraft.exe
您可能有一台 Razer 设备。他们的神弃软件偷偷加了_JAVA_OPTIONS,但是只在启动游戏的时候,所以你连CMD都看不到。理想情况下卸载该软件,并可能在您的 PC 上泼一些圣水。否则,您可能可以关闭 Synapse 并重新启动 minecraft.exe
Found (eventually) here: http://www.minecraftforum.net/forums/support/unmodified-minecraft-client/2183431-_java_options-picked-up-without-existing#reply
在这里找到(最终):http: //www.minecraftforum.net/forums/support/unmodified-minecraft-client/2183431-_java_options-picked-up-without-existing#reply
回答by Nabeel
This error occurs actually when you run an android application after compiling a java program. Eclipse uses java's compiler to execute android application. So run your android application as an android application. Just right click on project and click on run as->android application instead of run configurations.
这个错误实际上是在编译java程序后运行android应用程序时发生的。Eclipse 使用java 的编译器来执行android 应用程序。因此,将您的 android 应用程序作为 android 应用程序运行。只需右键单击项目并单击运行方式-> android 应用程序而不是运行配置。