I use Eclipse and turns out I have a bunch of import * not resolved errors.
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
All of the above have the same error. I checked my java version it is 1.7.0 open jdk. I updated Java Home and the JRE library to use. Its still not working. Note: I imported the code repository from bibucket via the mercurial plugin itself.
This is an issue relating JRE.In my case (eclipse Luna with Maven plugin, JDK 7) I solved this by making following change in pom.xml and then Maven Update Project.
from:
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
to:
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
Screenshot showing problem in JRE:
If by chance you have deleted JRE SYSTEM LIBRARY, then go to your JRE installation and add jars from there.
Eg:- C:\Program Files (x86)\Java\jre7\lib ---add jars from here
C:\Program Files (x86)\Java\jre7\lib\ext ---add jars from here
If the project is Maven, you can try this way :
Then the import issue should be solved .
Source: Stackoverflow.com