Specify Java Version

Is there is a way to specify Java version in to be validated and used for Java project build? Let’s say I check out project done on Java 7, but I have java 6 locally.

I would like to know what Java supposed to be used with out investigation.

apply plugin: ‘java’ sourceCompatibility = 1.7 targetCompatibility = 1.7