I'm trying to set up a Minecraft modding environment in IntelliJ. (I've settled for 1.12.2 as this version still by far the largest stable platform for Forge modding with the best support.)
Anyway, I've followed the instruction laid out in the Readme, as well as guides and videos online that date from only a few months ago, so the process should be the same to get a mod set up. However, I'm having an issue actually running the basic "mod" that is shipped with the Forge MDK. The full crash log is below:
---- Minecraft Crash Report ----
// My bad.
Time: 12/3/20 8:13 PM
Description: Initializing game
java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
at net.minecraft.client.Minecraft.readImageToBuffer(Minecraft.java:841)
at net.minecraft.client.Minecraft.setWindowIcon(Minecraft.java:680)
at net.minecraft.client.Minecraft.init(Minecraft.java:456)
at net.minecraft.client.Minecraft.run(Minecraft.java:378)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.legacydev.Main.start(Main.java:86)
at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Client thread
Stacktrace:
at net.minecraft.client.Minecraft.readImageToBuffer(Minecraft.java:841)
at net.minecraft.client.Minecraft.setWindowIcon(Minecraft.java:680)
at net.minecraft.client.Minecraft.init(Minecraft.java:456)
-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:378)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.legacydev.Main.start(Main.java:86)
at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29)
-- System Details --
Details:
Minecraft Version: 1.12.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_271, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 358011464 bytes (341 MB) / 785383424 bytes (749 MB) up to 7626293248 bytes (7273 MB)
JVM Flags: 0 total;
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML:
Loaded coremods (and transformers):
Launched Version: ${MC_VERSION}
LWJGL: 2.9.4
OpenGL: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
GL Caps:
Using VBOs: Yes
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs:
Current Language: ~~ERROR~~ NullPointerException: null
Profiler Position: N/A (disabled)
CPU: <unknown>
The only information I can find online is that this error is apparently caused by IntelliJ compiling the mod using Java 1.9. However, this is impossible in my case. The only JDK installed on my machine is version 1.8, which is also what my JAVA_HOME is set to, as well as the only JDK/RE in my PATH. There is no 1.9 JDK to build with. What's causing this, and how do I make it stop? I've checked and I am 100% sure that all compilation through IntelliJ is set to compile with Java 1.8 ONLY. Is there an option I've missed?
Minecraft Version: 1.12.2
Forge Version: 14.23.5.2854 (latest recommended)
JDK: 1.8.0_271
I do apologize if my question isn't as clear or concise as it could be. I've been struggling to get this working for almost a month now, and it's really draining me mentally and emotionally. I'm happy to provide more information as needed.