MinecraftPortCentral / Cauldron-Issues

Issue tracker for Cauldron - http://cauldron.minecraftforge.net
13 stars 6 forks source link

Problem with Server launcher.java.lang.reflect.InvocationTargetException #26

Closed Mark-0924 closed 9 years ago

Mark-0924 commented 9 years ago

i get this problem when running Run.bat

A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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.launch(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(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 8 more

bloodmc commented 9 years ago

You didn't run the installer or you deleted the minecraft_server.jar

Mark-0924 commented 9 years ago

i did run the installer and i haven't deleted minecraft_server.jar

Mark-0924 commented 9 years ago

nvm it works now thanks for your help

MarinusLeeuwerik commented 9 years ago

It would be greatly appriciated if you posted how you got it to work, not only me, but I bet others would benefit from that. I apparently have the same error as you had. Thanks in advance

Hegezcc commented 5 years ago

I got a similar issue (different project but same issue) fixed with these steps:

  1. downloading the vanilla server jar file of corresponding version from official Minecraft site
  2. putting to same directory with the server jar with name of minecraft_server.%version%.jar, for example minecraft_server.1.12.2.jar
  3. running the server (not the vanilla one)

The reason behind this is that the code couldn't load the log4j library, which is provided in vanilla jar. Providing that file allows Java to inject those libraries and get the server working.

marcdraco commented 5 years ago

I've had this issue - and I don't even know if this is the same Minecraft extension... but on Debian/Linux I had to modify the ServerStart.sh file and replace the ${minecraft_server} variable with the name of the server file. I'm assuming the enivornmental variable isn't being set but as I came in to the issue with nothing more than an error and a cry for help...

I would post more detail but I'm doing this remotely for my daughter's b/f and he boots me as soon as I get stuff working... Kids!

agarian-2 commented 5 years ago

Capture I'm having the same issue, but I don't know what's wrong...? run.bat is executing the forge file

EDIT: Nevermind, was just a file naming issue lol

alexfanqi commented 5 years ago

not sure how you guys solved it by renaming, it doesn't work for me. Instead, I found it is something to do with java version. I got this error in openjdk11, but everything works fine after I switch to openjdk8.

PadLex commented 5 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

Ch33toz commented 4 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

Hey, I'm new to server hosting and i was wondering where i can find this file at?

LeaderMegatron commented 4 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

THANK you. This resolved my issue.

samwu97 commented 4 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it. thank you,it helped me a lot

hubery-tao commented 4 years ago

not sure how you guys solved it by renaming, it doesn't work for me. Instead, I found it is something to do with java version. I got this error in openjdk11, but everything works fine after I switch to openjdk8.

Same problem as yours. Thanks for your suggestion! It's very useful.

GrayNekoBean commented 4 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

Just solved a same problem, thank youuuuu 😘

Hiddensquid22-debug commented 4 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it. Thank you very much i searching so much across thr internet you saved me🤗

halesyy commented 3 years ago

Using the update-alternatives command worked for me too. Great command to understand.

https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04

akhilyeddula commented 3 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

To anyone who is having the same problem, TRY THIS FIRST. This worked perfectly for me!

Bryan-Huke commented 3 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

To anyone who is having the same problem, TRY THIS FIRST. This worked perfectly for me!

I'm pretty new to this kind of thing, could someone walk me through how to do this solution?

Saadiq123 commented 3 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

To anyone who is having the same problem, TRY THIS FIRST. This worked perfectly for me!

Yep this fixed my problem

bogdikon commented 3 years ago

if i have windows?

akhilyeddula commented 3 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

To anyone who is having the same problem, TRY THIS FIRST. This worked perfectly for me!

I'm pretty new to this kind of thing, could someone walk me through how to do this solution?

Just copy and paste it into the terminal and then follow the prompt on screen.

pmolz commented 3 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

When i run this it tells me I only have 1 version of java available. How can i get my hands on java 8? Heres the output: "There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java Nothing to configure."

chezzzer commented 3 years ago

So apparently debain doesn't offer java 8 in their repositories, only 11. How can I get around this, been stuck for almost 2 hours now...

pmolz commented 3 years ago

So apparently debain doesn't offer java 8 in their repositories, only 11. How can I get around this, been stuck for almost 2 hours now...

I finally got a workaround: Java 8 SE On the oracle website there is a page with a special edition of java 8, for god knows why. https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

I would get the jdk-8u271-linux-i586.tar.gz file, as doesn't require any special software to unzip.

Haekthor commented 3 years ago

Yup, downloading jdk8 and swtiching to it worked for me aswell. Thanks a lot!

win10Device commented 3 years ago

Anyone Coming Across this becuz your getting the error on linux, this will fix it sudo apt-get install openjdk-8-jre. && sudo update-alternatives --config java then once java 8 installs, A option select will come up, press the number the will link to java 8, Fixed! :D

The Problem is that the Forge MC Server 1.12.2 does not support anything above java 8, > without errors relating to server starting on java

ethanready commented 3 years ago

Hello, I am on a mac, and whenever I do any commands listed above, I hit a 'command not found' error. Can anyone tell me how to fix this? If someone could direct me to some solutions, it would be much appreciated.

JacksonChen666 commented 3 years ago

Hello, I am on a mac, and whenever I do any commands listed above, I hit a 'command not found' error. Can anyone tell me how to fix this? If someone could direct me to some solutions, it would be much appreciated.

The command sudo update-alternatives --config java is a linux command. To change java versions on macos, you may want to follow this guide. Make sure you have java 8 installed before changing java versions.

Emanu1674 commented 3 years ago

What if i'm using windoooooowwwwwsssssss?????????????!!!!!

ethanready commented 3 years ago

I found that clarifying what version of java was worked for me because I had the latest and java 8. not sure if that helps, but yeah.

JacksonChen666 commented 3 years ago

What if i'm using windoooooowwwwwsssssss?????????????!!!!!

You could just search "how to change java version insert your os here" or just click here

danielrosnl commented 3 years ago

I got a similar issue (different project but same issue) fixed with these steps:

  1. downloading the vanilla server jar file of corresponding version from official Minecraft site
  2. putting to same directory with the server jar with name of minecraft_server.%version%.jar, for example minecraft_server.1.12.2.jar
  3. running the server (not the vanilla one)

The reason behind this is that the code couldn't load the log4j library, which is provided in vanilla jar. Providing that file allows Java to inject those libraries and get the server working.

This worked for me, thank you very much! (I am using Pterodactyl panel, for everyone using Pterodactyl and Forge this will probably work!)

POPLOPUK commented 3 years ago

You need to set the PATH to java 8. Your directory is probably using some other version of java.

Smilin-Dominator commented 3 years ago

I had the same problem with openjdk11. Using sudo update-alternatives --config java to switch to openjdk8 fixed it.

You're A Lifesaver!

Wolfsprit commented 3 years ago

Hello everyone ; i've tried everything that is said on this topic, but i still get the same error. Can someone help me?

The error : "sudo java -jar forge-1.12.2-14.23.5.2855.jar A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70) at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34) Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') at net.minecraft.launchwrapper.Launch.(Launch.java:34) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) " I can't find java 8 anymore...

arch-user-france1 commented 3 years ago

not sure how you guys solved it by renaming, it doesn't work for me. Instead, I found it is something to do with java version. I got this error in openjdk11, but everything works fine after I switch to openjdk8.

YES F JAVA LANGUAGE TO NEW BUT I NEED VERS 16 FOR 1.17 SERVER

Haekthor commented 3 years ago

People need to stop posting on this thread. Its fucking closed. Fixed. Read.

mysticalfoxie commented 3 years ago

Fixed this issue by downgrading from JDK 16.0.2 to Java 8. 😊

cnnn666v2 commented 3 years ago

nvm it works now thanks for your help

u son of a... people like you should be dead

mark0956 commented 2 years ago

kruva nmayátokat

heavyname commented 2 years ago

explorer_DhLzQrYvlN

[ WINDOWS 10 ]

hi guys, i'm fixed this problem.

I created a batch file jreup.bat

@echo off "C:\Program Files\Java\jre1.8.0_301\bin\java.exe" %* PAUSE

and edited start.bat

@ECHO OFF color 3 jreup -Xmx14024M -Xms14024M -jar forge.jar nogui PAUSE

searching your jre in C:\Program Files\Java

nikitasnt commented 1 year ago

I got a similar issue (different project but same issue) fixed with these steps:

  1. downloading the vanilla server jar file of corresponding version from official Minecraft site
  2. putting to same directory with the server jar with name of minecraft_server.%version%.jar, for example minecraft_server.1.12.2.jar
  3. running the server (not the vanilla one)

The reason behind this is that the code couldn't load the log4j library, which is provided in vanilla jar. Providing that file allows Java to inject those libraries and get the server working.

This helped me with running the FTB Infinity Evolved server on Windows. Vanilla server for version 1.7.10 I found here https://mcversions.net/download/1.7.10

otisswag commented 7 months ago

I got a similar issue (different project but same issue) fixed with these steps:

  1. downloading the vanilla server jar file of corresponding version from official Minecraft site
  2. putting to same directory with the server jar with name of minecraft_server.%version%.jar, for example minecraft_server.1.12.2.jar
  3. running the server (not the vanilla one)

The reason behind this is that the code couldn't load the log4j library, which is provided in vanilla jar. Providing that file allows Java to inject those libraries and get the server working.

im about to blow