从cmd发射我的世界的错误

时间:2014-07-27 11:29:59

标签: java json exception gson minecraft

简单: 我加入了这个:

@echo off
cd\
set MCDIR=%APPDATA%\.minecraft
cd %MCDIR%
java -Xmx1024M -Djava.library.path="%MCDIR%\versions\1.7.10-LiteLoader1.7.10\1.7.10-LiteLoader1.7.10-natives" -cp "%MCDIR%\libraries\org\apache\logging\log4j\log4j-api\2.0-beta9\log4j-api-2.0-beta9.jar;%MCDIR%\libraries\org\apache\logging\log4j\log4j-core\2.0-beta9\log4j-core-2.0-beta9.jar;%MCDIR%\libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar;%MCDIR%\libraries\com\mojang\authlib\1.3\authlib-1.3.jar;%MCDIR%\libraries\io\netty\netty-all\4.0.10.Final\netty-all-4.0.10.Final.jar;%MCDIR%\libraries\java3d\vecmath\1.3.1\vecmath-1.3.1.jar;%MCDIR%\libraries\net\sf\trove4j\trove4j\3.0.3\trove4j-3.0.3.jar;%MCDIR%\libraries\net\sf\jopt-simple\jopt-simple\4.5\jopt-simple-4.5.jar;%MCDIR%\libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;%MCDIR%\libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;%MCDIR%\libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;%MCDIR%\libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;%MCDIR%\libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;%MCDIR%\libraries\com\google\guava\guava\15.0\guava-15.0.jar;%MCDIR%\libraries\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;%MCDIR%\libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;%MCDIR%\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;%MCDIR%\libraries\net\java\jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar;%MCDIR%\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;%MCDIR%\libraries\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;%MCDIR%\libraries\org\lwjgl\lwjgl\lwjgl\2.9.0\lwjgl-2.9.0.jar;%MCDIR%\libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.0\lwjgl_util-2.9.0.jar;%MCDIR%\versions\1.7.10-LiteLoader1.7.10\1.7.10-LiteLoader1.7.10.jar" net.minecraft.client.main.Main --username psrcek --version 1.7.10-LiteLoader1.7.10 --gameDir C:\Users\David\AppData\Roaming\.minec~1 --assetsDir C:\Users\David\AppData\Roaming\.minec~1\assets --accessToken 70ead0e496e84d569ece26f01c122eeb --uuid 15ad0e60-8691-4e29-9de9-2d6b538bf56d **--userProperties = "rni30u9cq1yfvsu0w665371mnjdrsss"**

我得到了这个例外: (我用**标记的文字有问题)

Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.
stream.MalformedJsonException: Expected value at line 1 column 1
    at com.google.gson.Gson.fromJson(Gson.java:818)
    at com.google.gson.Gson.fromJson(Gson.java:768)
    at com.google.gson.Gson.fromJson(Gson.java:717)
    at net.minecraft.client.main.Main.main(SourceFile:116)
Caused by: com.google.gson.stream.MalformedJsonException: Expected value at line
 1 column 1
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505)
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:586)
    at com.google.gson.stream.JsonReader.peek(JsonReader.java:414)
    at com.google.gson.Gson.fromJson(Gson.java:799)
    ... 3 more

1 个答案:

答案 0 :(得分:1)

--userProperties = "rni30u9cq1yfvsu0w665371mnjdrsss"

这样的选项通常是在没有干预'='的情况下指定的,所以我试试

--userProperties "rni30u9cq1yfvsu0w665371mnjdrsss"

命令行解析的规则是查找选项(--optionname),如果需要参数,请从命令行中获取(空白分隔的)下一个单词作为参数。