Enigmatica 2: Expert - Extended

Enigmatica 2: Expert - Extended

194k Downloads

A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException

Boerny41 opened this issue ยท 4 comments

commented

Description

When trying to execute the ServerStartLinux.sh I keep getting the same error. Google is full of it, but the solutions give don't seem to help. I'm sure it's a well known/minor thing but this is my first time trying to set up a server and it seems like I'll need some help.

I've installed openjdk 17.0.9 (17.10.2023) and downloaded the official minecraft_server.1.12.2.jar from mojang and placed it inside the E2E extended folder. Serverstart.log and installer.jar.log both look good to me, ending with server installed successfully and sever started respectively.

Edit: I thought maybe openjdk 17.0.9 is not the right one even through it is the most recent I can get through apt-get. I manually installed openjdk 21.0.1 but still get a slightly different error.

OS: Debian bookworm

openjdk 17.0.9:

Starting server
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:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        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.<init>(Launch.java:34)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        ... 6 more

openjdk 21.0.1:

java version "21.0.1" 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)

About to start server. Force re-install (y/n)?  y
User chose to manually re-install server files
Starting install of Forge/Minecraft server binaries
https://maven.minecraftforge.net/net/minecraftforge/forge/1.12.2-14.23.5.2860/forge-1.12.2-14.23.5.2860-installer.jar
Moving unneeded files/folders to ./DELETEME
Installing Forge Server, please wait...
Deleting Forge installer (no longer needed)
Skipping internet connectivity check
Could not find eula.txt starting server to generate it


Starting server
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:109)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        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.<init>(Launch.java:34)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 3 more

Press any key to continue when you've accepted the EULA. Press CTRL+C to exit.

To Reproduce

Steps to reproduce the behaviour:

  1. download and unpack the server.zip
  2. install openjdk
  3. execute the ServerStartLinux.sh

Modpack version v1.26.0

installer.jar.log
serverstart.log

commented

1.12.2 Minecraft can only run on Java 1.8
Try to remove newer Java versions and install Java 1.8.

In other problems - I can't help. I don't know how ServerStartLinux.sh script working, I just copy-pasted it from the E2E. So you might try to find solution in E2E discord or E2E subReddit.

To be sure it's not E2E-E problem exclusively you can try to run E2E server.

commented

I just tried with Java 8 but still get the same error. I'll go and ask on discord, it's probably more appropriate there.

commented

I just tried with Java 8 but still get the same error. I'll go and ask on discord, it's probably more appropriate there.

That implies you are not properly changing java version - java 8 literally cannot produce this exact error

commented

I thought that openjdk 18 was Java 8. Turns out it is not and everything works as intended with the correct version. Thanks guys.