I use Java 15 for my example. I used Eclipse IDE for Java Developers - 2020-12.
I got an error shown below when I define SimpleDateFormat to handle with formating a date object.
import java.text.SimpleDateFormat; // error -> The import java.text.SimpleDateFormat cannot be resolved
How can I fix my issue?
Try selecting the correct Execution environment or alternate JRE:
Build Path --> Configure Build Path --> Libraries --> Double click JRE System Library.