解决
the type javax.net.SocketFactory cannot be resolved. It is indirectly referenced from required .class files
Solution:
1. Go to the project
2. Right click and select Build Path->Conifgure Build Path
3. Click on the Libraries tab
4. Select the rt.jar file (part of the JRE) if visible
6. Click Remove (buttons are at the right hand side)
7. Click on Add Library
8. Select JRE System Library, then click Next
9. Select Workspace default JRE (If one is not available, you have to Installed JREs)
10. Click Finish
11. Click OK
12. Refresh