Fabric API

Fabric API

106M Downloads

Error: Could not find or load main class net.fabricmc.devlaunchinjector.Main Caused by: java.lang.ClassNotFoundException: net.fabricmc.devlaunchinjector.Main

EnergixCoding opened this issue ยท 7 comments

commented

Recently, I have been trying to make a mod on fabric.

I have been trying to make Items and Mobs and things like that, but I get an error saying:
Error: Could not find or load main class net.fabricmc.devlaunchinjector.Main
Caused by: java.lang.ClassNotFoundException: net.fabricmc.devlaunchinjector.Main
when I try to launch the mod.

Anyone have a fix?
Error

commented

I am very confused on why this is happening.

commented

If you are using vscode try gradle vscode to set up the project. Also this is for fabric api problems. Mod dev problems is preferably asked on discord.

commented

@liach It says the build failed in 2 seconds.

commented

run with gradle vscode -S and post the gradle log (error log)

commented

gradle : The term 'gradle' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1

  • gradle vscode -S
  •   + CategoryInfo          : ObjectNotFound: (gradle:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
commented

I also just started having this problem today in IntelliJ. Both myself and a collegue of mine

I tried performing some setup steps (Like gradle idea) but it hasn't helped. Something must've updated.

commented

Close your idea project, do gradle clean idea, and then import the ipr file generated by gradle. It should work.