[p]Hey so I am currently trying to launch a server that I have launched successfully before. It is a custom modpack server that is running on Minecraft 1.12.2. I've run the server successfully numerous times before. When I launch start.sh, I get the error below. The server does launch by double-clicking the server.jar file but I can not allocate more than 2 GB if I do so. The text within the start.sh file is also below. I made sure its on plain text format and that the quotes are straight quotes but I keep getting this message. Someone please help.[/p]
[p]Server folder:[/p]
[p]Attached below[/p]
[p]start.sh file:[/p]
[p]#!/bin/bash
cd "$(dirname "$0")"
exec java -Xms2G -Xmx8G -jar forge-1.12.2-14.23.5.2772-universal.jar nogui[/p]
Error:[/p]
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException[/p]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[/p]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[/p]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[/p]
at java.base/java.lang.reflect.Method.invoke(Method.java:567)[/p]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)[/p]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34)[/p]
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')[/p]
at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)[/p]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)[/p]
... 6 more[/p]
java version "12.0.1" 2019-04-16[/p]
Java(TM) SE Runtime Environment (build 12.0.1+12)[/p]
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)[/p]
[p]Server folder:[/p] [p]Attached below[/p]
[p]start.sh file:[/p] [p]#!/bin/bash
cd "$(dirname "$0")"
exec java -Xms2G -Xmx8G -jar forge-1.12.2-14.23.5.2772-universal.jar nogui[/p]
Error:[/p] A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException[/p]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[/p]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[/p]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[/p]
at java.base/java.lang.reflect.Method.invoke(Method.java:567)[/p]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)[/p]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34)[/p]
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')[/p]
at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)[/p]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)[/p]
... 6 more[/p]
[Process completed][/p]
Post results after executing the following command in a terminal: java -version
Java(TM) SE Runtime Environment (build 12.0.1+12)[/p]
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)[/p]
Java 12 is not supported, use Java 8.
I installed Java 8 and am still getting the same message. I restarted the computer and it still didn't work. Should I remake the server file?
Actually I installed Java 8 but java -version still says I'm running Java 12.
Ok downgrading to Java 8 worked thank you so much.
Please tag this as "Resolved".
I do not think you need "nogui" on Linux.