Class "Robot" needs to be defined in it's own file

I’ve run into this Java compile error more than once and it doesn’t make sense. In the source file, I declare the class “Robot”

public class Robot extends TimedRobot {


I get the compile error:

Task :compileJava FAILED
C:\Users\3Zman\VS Workspace\IntakeThreadTest_3\src\main\java\frc\robot\Robot .java:36: error: class Robot is public, should be declared in a file named
public class Robot extends TimedRobot {

This doesn’t make any sense to me.

In the error output it seems the file is named Robot<space>.java. Probably double check that.


Do you have a file? I had an issue with an older project that didn’t convert correctly that was missing that file.

That was it. Thanks.

1 Like

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