Non-Correct Syntax Error During Java Compile on DSA sub-array sum

Hello, can some one confirm that while using Maps, the compiler throws an error while the syntax is completely correct. Also I though the IDE uses java 8 but it throws java 6 errors.

Main.java:6: error: illegal start of type
import java.util.Map;
^
Main.java:6: error: <identifier> expected
import java.util.Map;
                    ^
Main.java:7: error: illegal start of type
import java.util.HashMap;
^