How to specify java version when running gradle build?

(Niamh) #1

Hi there,

I’m trying to build a .jar ( specifically. Running “grade build” from command line works as it should, but it’s giving me a jar in java 1.8, whereas I need 1.6. When I do gradle -version it says my java is 1.8, which makes sense. How would I go about changing it so it uses 1.6?


(Niamh) #2

Fixed. Just had to add sourceCompatibility = 1.6 to the build.gradle