error: redefinition

error: redefinition of ‘int main()’

In function ‘int main()’:
error: redefinition of 'int main()

I am kind of stuck with this error. It is confudeing me since I do not have main defined anywhere else in the program, and only as the main method in my Java interface. I inherited this code from a friend for a robotics project. He is not around to help with the project anymore and unfortunately he handled all the Arduino code. We are con controlling a robot through a Java Eclipse interface, using an Arduino Mega board with Xbee to control some servo motors and dc motors. This is the only tab that is open for the Arduino programming as well

Below is the snippet of code that the error is apparently referring to.

int main(void)
          for (;;)
      return 0;

Any help for this error would be greatly appreciated. Thanks!

Where are you seeing this error? In the Arduino IDE?

If so, delete the whole main function. The IDE adds another one during the compilation process.

What does Java have to do with the problem with C code?