forge_client gradle task always fails with error "Could not find or load main class net.minecraftforge.userdev.LaunchTesting"
To give some context, I have gotten the forge_client task to work in the past; I'm positive this is an environment issue, but not sure how to fix it. This issue started once I updated to IntelliJ 2020. Additionally, I am not a Java developer in my day job. While I have decent experience with Java, I am normally a Node.js developer (JS, yuck). This is all to say that I "generally" know what I am doing, but need some environment setup help since I don't usually use IntelliJ. I've seen many other people with this exact issue, so I think this post may help many others in the future.
Here is a stack trace of the latest run:
STACK TRACE (pastebin)
Additionally, I've attached a screenshot of the Run Configuration for the forge_client task. Keep in mind that this screenshot is from IntelliJ 2020.3; if you have a different version, it will probably look different (much to our collective dismay ๐)
My Setup:
System details
Ubuntu 18.04.5 LTS
Java - OpenJDK 1.8.0_282
IDE Details
IntelliJ IDEA CE 2020.3
Gradle Version 4.9
Forge Details
Cloned repo from GitHub
Branch 1.16.x
I have tried other branches and hit a similar error in the same spot ("Could not find or load main class..."), but the class name is different
What I have tried:
Forge Docs - "Getting Started with Forge" (general modding with Forge docs)
Forge Docs - Contributing to Forge - "Getting Started" (docs on how to contribute to the actual Forge code base)
In both of these documents, the "core step" appears to be to run the forge_client task, which should start the forge client from within the repo. In both cases, I've tried:
Opened the build.gradle file as a project when opening it in IntelliJ > wait for project setup stuff to finish
Run the setup gradle task > Run genIntellijRuns gradle task > Run the forge_client gradle task
This is where I hit the "Could not find class" error
Notes
The clean_client gradle task works without issue, presumably because it doesn't need this LaunchTesting class
If I change the dropdown in the run configuration from -cp Forge.forge to -cp Forge, I get a run configuration error saying the LaunchTesting class doesn't exist in Forge module
Any help on this is much appreciated! I've found several posts with this exact problem, but no follow up - makes me think it was some simple config issue they figured out and never posted the solution (shame). Us simpletons would like to know how to make minecraft mods as well ๐