嗨,我当时正试着在“锻造”下编写一个“我的世界”发射器的代码,我得到了一个错误:
[OpenLauncherLib] Launching Minecraft
[OpenLauncherLib] Successfully launched
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was
deprecated in version 9.0 and will likely be removed in a future release.
Unrecognized VM option 'CMSIncrementalMode'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.这是我的代码:
public class Launcher {
public static final GameVersion SC_VERSION = new GameVersion("1.7.10", GameType.V1_7_10);
public static final GameInfos SC_INFOS = new GameInfos("Lunaria", SC_VERSION ,true ,new GameTweak[] {GameTweak.FORGE});
public static final File SC_DIR = SC_INFOS.getGameDir();
private static AuthInfos authInfos;
private static Thread updateThread;
public static void auth(String username, String password) throws AuthenticationException{
Authenticator authentificator = new Authenticator(Authenticator.MOJANG_AUTH_URL, AuthPoints.NORMAL_AUTH_POINTS);
AuthResponse response = authentificator.authenticate(AuthAgent.MINECRAFT, username, password, "");
authInfos = new AuthInfos(response.getSelectedProfile().getName(), response.getAccessToken(), response.getSelectedProfile().getId());
}
public static void update() throws Exception {
SUpdate su = new SUpdate("https://launcherpanel.000webhostapp.com/", SC_DIR);
su.addApplication(new FileDeleter());
updateThread = new Thread() {
private int val;
private int max;
@Override
public void run() {
while(!this.isInterrupted()) {
if(BarAPI.getNumberOfFileToDownload() == 0){
LauncherFrame.getInstance().getLauncherPanel().setInfoText("Verification des fichers...");
continue;
}
val = (int) (BarAPI.getNumberOfTotalDownloadedBytes() / 1000);
max = (int) (BarAPI.getNumberOfTotalBytesToDownload() / 1000);
LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setMaximum(max);
LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setValue(val);
LauncherFrame.getInstance().getLauncherPanel().setInfoText("Telechargement des fichiers... "
+ BarAPI.getNumberOfDownloadedFiles() + "/" + BarAPI.getNumberOfFileToDownload() +
Swinger.percentage(val, max) + "%");
}
}
};
updateThread.start();
su.start();
if(updateThread != null)
updateThread.interrupt();
}
public static void launch() throws IOException {
GameLauncher gameLauncher = new GameLauncher(SC_INFOS,GameFolder.BASIC,authInfos);
Process p = gameLauncher.launch();
try {
Thread.sleep(5000L);
} catch (InterruptedException e) {
}
LauncherFrame.getInstance().setVisible(false);
try {
p.waitFor();;
} catch (InterruptedException e) {
}
System.exit(0);
}
public static void interruptThread() {
updateThread.interrupt();
}
}谢谢你的回答。编辑:我在mac os X 10.10下
发布于 2020-09-27 14:11:44
这看起来并不是关于您的启动程序,而是关于JVM正在传递一个它无法处理的参数。您的程序通常是这样加载的:
。
目前您的代码没有一个被执行,因为要执行它的JVM无法自行执行。
重申一下,结构是这样的:
OS > JVM > JAR
您目前正在研究这一部分:
OS > JVM > JAR
你应该看看这部分:
OS > JVM > JAR
正如@ JVM 1所述,当前一个参数CMSIncrementalMode作为参数传递给您的JVM。它无法处理这一论点,并拒绝参选。您的代码都不会被执行。您可以从错误消息中派生出这一点:
Unrecognized VM option 'CMSIncrementalMode'
Error: Could not create the Java Virtual Machine.https://stackoverflow.com/questions/64086889
复制相似问题