Could not find or load class frc.robot.main

My team has recently started experimenting with the ROMI bots to teach new members, when we try to start the code, we get an error message:

Error: Could not find or load main class frc.robot.Main    

Caused by: java.lang.ClassNotFoundException: frc.robot.Main

We’ve tried running the romi example project with zero modifications as well as blank romi template projects and we end up with the same result. Has anybody else had this issue in the past?

Can you share the entire robot project? Did you fully install WPILib?

This error is nearly always caused by

  • Your project is invalid
  • You didn’t install WPILib

I have everything installed last I checked, but I’ll try reinstalling it fresh because maybe it’s outdated.

Do you have a Main.java file in the src/main/java/frc/robot/ directory? Because that’s what the error is about.

Reinstalling WPILib seems to have solved the issue, and yes, I did have a Main.java file with a correct ROBOT_MAIN_CLASS variable in the build.gradle file. Probably something screwed up with my WPILib installation.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.