To get rid of the first one, you need to open up
File -> Project Structure -> Project Settings -> Modules -> "Your Module Name" -> Sources -> Language Level
and change that to the desired level i.e 1.8 or the Project Default language level
To fix the second one:
- File > Settings > Build, Execution, Deployment > Java Compiler
- Change Target bytecode version to 1.8 of the module that you are working for.