Reputation: 81
I was programming a fabric minecraft mod in intellij and when I ran the code it said :
Could not find or load main class net.fabricmc.devlaunchinjector.Main
When I compiled the code and tried it in minecraft it worked, but in intellij i couldn't run it.
Upvotes: 5
Views: 16595
Reputation: 1
I had the same problem. Everything was working fine until, all of a sudden, the mod refused to start due to the missing class, even though I hadn't touched any of the mod's libraries.
I managed to fix the issue in a really weird way and still don't understand what caused it, or how this solution fixed it. I simply copied the .idea
folder, then deleted it and restarted IntelliJ. After the restart, IntelliJ had recreated the .idea
folder, but I deleted it again and replaced it with my original copy.
Upvotes: 0
Reputation: 183
Deleting the .idea
folder and restarting IntelliJ solved the issue for me.
Upvotes: 1
Reputation: 41
thecoopsyt's answer worked for me.
Go to Gradle tab > Reload All Gradle Projects
Wait a few mins for it to check and update your dependencies.
After this I was able to return to testing my project in Intellij... had to fully compile and test before this fix.
Upvotes: 2
Reputation: 1
In Intellij gradle if
this doesn't work you can put
downloadAssets runClient into a gradle config and it will start a client and download the net.fabricmc.devlauncherinjector.Main this allows you to use gradles built in Minecraft Client
Upvotes: -1
Reputation: 81
I was messing around with the files, to see if I can fix it and I found a solution :
Upvotes: 3