Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Introducing Spring Data REST

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 Points

Error: "Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents..."

I'm following along with this video, and some things about the gradle file that were generated are different. Also, I had to download a new version of the JDK fresh since when I did the prerequisites, and I downloaded Java 10. It's giving me an error that I don't know how to resolve:

Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/java.

Here is my gradle file:

group 'com.teamtreehouse'
version '1.0-SNAPSHOT'


buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath('org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE')
    }
}

plugins {
    id 'java'
    id 'spring-boot'
}


sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.springframework.boot:spring-boot-starter-data-rest'
    compile 'org.springframework.boot:spring-boot-starter-data-jpa'
    compile 'com.h2database:h2'
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

Should I downgrade to an older version of Java? How do I get more familiar with IntelliJ and what's going on here with the various configuration settings?

Gustavo Winter
Gustavo Winter
Courses Plus Student 27,382 Points

Maybe the dependencies doesn't support Java 10, try to update the dependencies (for the most recent release) or use Java 8. If this doesnt fix the problem, tell me.

1 Answer

If you are on a mac, check your directory /library/Java/JavaVirtualMachine folder, check if there are multiple JDK, leave one JDK and delete the rest.