From the command line, change your call to:
javac -source 1.7 -target 1.7 HttpsTest.java SSLSocketFactoryEx.java
The documentation for javac (for JDK 8) is here.
The documentation for javac (for JDK 9) is here.
Note: In JDK 9, -target is replaced with --release.