执行jar时出现Java错误

时间:2015-03-31 14:06:33

标签: java ubuntu-14.04 minecraft

我的机器上安装了Ubuntu服务器14 LTS,当我尝试使用Java(openjdk-6-jre)启动Minecraft时,它失败了。与7版本相同。

这是控制台输出:

   root@server:~# java -jar /home/server/minecraft/forge.jar
A problem occurred running the Server launcher.
java.lang.reflect.InvocationTar.getException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at cpw.mods.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43)
        at cpw.mods.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12)
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Level
        at net.minecraft.launchwrapper.Launch.la unch(Launch.java:94)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        ... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Level
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
         ... 8 more

2 个答案:

答案 0 :(得分:0)

检查文档以了解如何设置java classpath。看起来它无法从异常中找到log4j.jar文件。通常它会像下面的

java -cp pathtoJar1:pathToJar2... -jar pathtoforg.jar

答案 1 :(得分:0)

http://keinett.com/forums/index.php?threads/shiginima-launcher-1-602-crash-with-forge-1-8-11-14-0-1281.1509/ 说那个

  

该启动器不支持伪造1.8。你必须使用   官方发射器。

他们有相同的堆栈跟踪:

Client> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/Level
Client> at net.minecraft.launchwrapper.Launch.launch(Launch.java:94)
Client> at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Client> Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Level
Client> at java.net.URLClassLoader$1.run(Unknown Source)
Client> at java.net.URLClassLoader$1.run(Unknown Source)