I did everything correctly. I'm trying to setup a server on google cloud (I want to host it on google cloud don't suggest other sites please)
1. Downloaded the installer from http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.12.2.html
2. Used this to install the server
java -jar forge-1.12.2-14.23.5.2854-installer.jar --installServer
3. I now have those files in the directory
1.12.2.json
forge-1.12.2-14.23.5.2854-installer.jar.log
libraries
forge-1.12.2-14.23.5.2854-installer.jar
forge-1.12.2-14.23.5.2854.jar
minecraft_server.1.12.2.jar
4. I use this on minecraft_server.1.12.2.jar to install the rest of the files
java -jar minecraft_server.1.12.2.jar nogui
5. I now have those files in the directory
1.12.2.json
forge-1.12.2-14.23.5.2854-installer.jar.log
logs
eula.txt
forge-1.12.2-14.23.5.2854.jar
minecraft_server.1.12.2.jar
forge-1.12.2-14.23.5.2854-installer.jar
libraries
server.properties
6. I accept the eula.txt
7. There is no forge universal file like in literally all the tutorials i've seen so this is what happens when I try to run
minecraft_server.1.12.2.jar: The server runs normally but it's vanilla and even if I create a mods folder and insert mods inside nothing happens
forge-1.12.2-14.23.5.2854.jar: It throws this at me
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 cl
ass java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in mod
ule 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
for both the command is java -Xmx7G -Xms1G -jar [filename] nogui
I've been trying for 4 hours so far, I tried re-installing the server multiple times, I tried updating java, I tried deleting and re-installing java.