If you see bunch of red underlines, and even see "String cannot be resolved to a type", then you need to make sure your correct JRE is added to the Java Build Path.
Right click on your Project and select Properties, then go to Java Build Path. On the Library tab as shown, if you see a JRE System Library, remove it.

Now click Add Library and Select JRE System Library.

Select Workplace Default.