Start.bat error

Not sure what it means but I get this. I’m using Java 8 not sure if it has to be a special version.

A problem occurred running the Server
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.base/java.lang.reflect.Method.invoke(
        at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class (jdk.internal.loader.ClassLoaders$AppClassLoader and are in module java.base of loader 'bootstrap')
        at net.minecraft.launchwrapper.Launch.<init>(
        at net.minecraft.launchwrapper.Launch.main(
        ... 6 more

You’re not using Java 8, which I can tell here because some of the packages start with java.base/, if you run java -version you should see which version you’re actually running.

It says

openjdk version "16.0.2" 2021-07-20
OpenJDK Runtime Environment Temurin-16.0.2+7 (build 16.0.2+7)
OpenJDK 64-Bit Server VM Temurin-16.0.2+7 (build 16.0.2+7, mixed mode, sharing)

But when I goto add or remove programs it just says Java 8 Update 321 and Java SE Development Kit 8 update 321 (64-bit)

How can I change what version my computer uses?

You have OpenJDK installed of Java 16.

In your uninstalling it, its likely called AdoptOpenJDK or something like that.

However if you need java 16 for something else, you can copy the folder path of where it is installed and paste that in before the java in the runner

So it would be C:/ProgramFiles/Java/Jre/8/bin/java -jar sponge.jar or something like that.

Or you can also just change the default one your computer uses by swapping the JAVA_HOME

Where would OpenJDK or “AdoptOpenJDK” be located?

AdoptOpenJDK has a install path when it starts.

On windows, i think its


I don’t see it anywhere, could you provide a link to the correct java 8 installation? So I could just swap it out in Environment properties

If your on windows, you can find what the default java location is by running the command

echo %JAVA_HOME%

Just did that and pasted it in the destination bar so it leads it to me but the Java file no longer exists I’m guessing because I already uninstalled it in the Add or Remove programs.

Is there a command like Java -uninstall ?

No such command, its all uninstalled though windows.

If i was you, i would uninstall Java 8, and then install AdoptOpenJDK 8 which has the option to install to the JAVA_HOME (you must tick the option) in the installer

I am so so sorry, I just realized I didn’t search JDK in the uninstall program I just uninstalled it now when I run java -version nothing happens so I’m going to go download java 8.

Thank you so much for trying to help me

1 Like

Ok so my brain has decided to stop functioning, where do I download Java 8 from?

Edit: Got it!