Eclipse Java Compile Issue

I have an iterative robot project that I split up into a number of packages. I added two extra packages underneath the usual org.usfirst.frc.team2635.robot package. Before splitting the project into packages, I was able to upload to the robot just fine. Now when I try to run, I get a long string of build errors like this:


compile:
    [mkdir] Created dir: C:\Users\localuser\Desktop\workspace\LiftBotJava\build
     [echo] [athena-compile] Compiling src with classpath=${wpilib.jar}:${networktables.jar} to build
    [javac] Compiling 26 source files to C:\Users\localuser\Desktop\workspace\LiftBotJava\build
    [javac] C:\Users\localuser\Desktop\workspace\LiftBotJava\src\org\usfirst\frc	eam2635\robot\IElevationSetter.java:3: error: package edu.wpi.first.wpilibj does not exist
    [javac] import edu.wpi.first.wpilibj.SpeedController;
    [javac]                             ^
    [javac] C:\Users\localuser\Desktop\workspace\LiftBotJava\src\org\usfirst\frc	eam2635\robot\IElevationSetter.java:7: error: cannot find symbol
    [javac] 	void setLiftElevation(Double setPoint, SpeedController lift1, SpeedController lift2);
    [javac] 	                                       ^
    [javac]   symbol:   class SpeedController
    [javac]   location: interface IElevationSetter
    [javac] C:\Users\localuser\Desktop\workspace\LiftBotJava\src\org\usfirst\frc	eam2635\robot\IElevationSetter.java:7: error: cannot find symbol
    [javac] 	void setLiftElevation(Double setPoint, SpeedController lift1, SpeedController lift2);
    [javac] 	                                                              ^
    [javac]   symbol:   class SpeedController
    [javac]   location: interface IElevationSetter

And so on for 100 errors. Has anyone else had this problem?

It would help if you posted your project.

Your build is having trouble finding the WPILIB library files, which should be “wpilib” directory in your home directory.

The third line of your log (the one describing the classpath) is a little weird, like it knows which two JAR files to load, but doesn’t know where they are. This line should usually be an explicit pair of file paths.

You could try diagnosing the build.xml and build.properties files (there are some in your project directory and others under the wpilib directory). Or, you could just try trashing your wpilib directory and then reloading the FRC plugins.

I’m guessing you have imported an existing project into eclipse.

Try creating a new FRC Java robot project, compiling the new project and compiling this one again.

It can’t find the wpilib jars because it thinks your classpath is “${wpilib.jar}”. This should automatically get replaced by the actual classpath by whatever ant reads from the build.properties file. This doesn’t get set up properly until you’ve created a new project.