Looks like that portion of your code is without errors.
When the compressor stops running, do you see any error messages printed out to the DriverStation or, if you are connected to your coding computer, in the console?
Are other functions of your robot still operating when the compressor stops running? for example, can you still drive the robot around?
Can you post the rest of the code from your project?
Note, use the [ code ] and [ / code ] tags (without spaces) around a block of code, and it will be easier for people to read.
example:
Code:
public class RobotTemplate extends IterativeRobot {
Compressor compressor = new Compressor(1, 1);
public void robotInit() {
compressor.start();
}
}