Creating a jar for LibGDX game

Hi,

I am having issues with deploying my game to a jar.
I am pasting “gradlew desktop:dist” in the terminal but get some error messages:

:core:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
C:\Users\Daniel\Documents\LibGDXProject\DesktopTest\core\src\com\desktoptest\game\DesktopTesst.java:20: error: diamond operator is not supported in -source 1.6
ArrayList test = new ArrayList<>();
^
(use -source 7 or higher to enable diamond operator)
1 error
1 warning
:core:compileJava FAILED

It seems the compiler wants to use java 1.6 for deploying even though it uses 1.7 when I just compile it in intellij without problem.
I looked everwhere in the settings to find some setting still set to 1.6, but could not find anything.
No luck finding a solution online either.