Why intelliJ is trying to use java 12 if i set as SDK version 11.0.4?

I am trying to run a small java code that someone else made using intelliJ (I am a beginner); but for some reason even if I have selected java 11.0.4(3) from project settings, after building it I get the message:

Error:java: error: release version 12 not supported 

so I decided to install java 12 following this guide: http://ubuntuhandbook.org/index.php/2019/03/install-oracle-java-12-ubuntu-18-04-16-04/ and the terminal also says now i have as default java 12.02.

I added java 12 to intelliJ’s SDKs but now if I switch the project’s version from 11 to 12 I get another error, at runtime this time:

java.lang.UnsupportedClassVersionError: (class path) has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 55.0 

so I don’t understand, what does intelliJ want, to be able to run this?