我正在尝试在程序中启动Minecraft。问题是,如果我安装了64位计算机和Java-64bit,那么如果我放了超过1Gb的内存,我就不想启动。
ArrayList<String> arguments = new ArrayList();
arguments.add("-cp");
arguments.add(this.profile.getClassPath());
arguments.add(this.profile.getMainClass());
arguments.add("--username=" + authInfos.getUsername());
arguments.add("--accessToken");
arguments.add(authInfos.getAccessToken());
arguments.add("--version");
arguments.add(infos.getGameVersion().getName());
arguments.add("--gameDir");
arguments.add(infos.getGameDir().getAbsolutePath());
arguments.add("--assetsDir");
File assetsDir = new File(infos.getGameDir(), folder.getAssetsFolder());
arguments.add(assetsDir.getAbsolutePath());
arguments.add("--assetIndex");
String version = infos.getGameVersion().getName();
arguments.add(version.substring(0, version.lastIndexOf(46)));
arguments.add("--userProperties");
arguments.add("{}");
arguments.add("--uuid");
arguments.add(authInfos.getUuid());
arguments.add("--userType");
arguments.add("legacy");
命令参数:
Entire command : "C:\Program Files (x86)\Java\jdk1.8.0_221\jre\bin\java" -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Djava.library.path=C:\Users\black\AppData\Roaming\.HuntiesCraft-Network\Sides\Modded\natives -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true -Xmx2048M
-cp **libraries...**
--username=Naruse --accessToken 8124ce16f062472a9d418dd83530bebb
--version 1.12
--gameDir C:\Users\black\AppData\Roaming\.HuntiesCraft-Network\Sides\Modded
--assetsDir C:\Users\black\AppData\Roaming\.HuntiesCraft-Network\Sides\Modded\assets
--assetIndex 1
--userProperties {}
--uuid c9c6a38f-27e8-460b-802e-d3f0ca36e390
--userType legacy
错误日志:
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release