compileGroovy keeps failing

Hey,

I’m new to gradle but got it on my Ubuntu machine. Thing is, whatever I try to do, it always fails on the compileGroovy step, claiming it cannot import common Java packages like java.nio.file.Files. Even ‘gradle clean’ will result in several of these errors:

unable to resolve class java.nio.file.Files
 @ line 6, column 1.
   import java.nio.file.Files;

I cannot find anybody with similar issues, not on Google and not in my vicinity, so I’m at a loss on where to start looking for solutions.

I’m using Java 1.6.0_45, gradle 2.4 and Ubuntu 14.04.2. My Eclipse and other Java programs work fine btw.

Anybody who can give me a few pointers?

Thanks,
Ingo

java.nio.file.Files was first introduced in Java 7/1.7, so it’s only available in JDKs later than that. You’re using Java 6/1.6, so those classes aren’t available.

Right you are; I just found that I was using Java6… :o( Updated my java alternatives and now it works fine.

Thanks for your solution. Now I can really dive into this.

Cheers!
Ingo