Could not determine java version

Enonic version: 6.13.1
OS: 10.13.3

I´m working my way through the «My first app» tutorial, and got to the following step: http://docs.enonic.com/en/6.13/tutorials/my-first-app/build-and-deploy.html

When I add the command ./gradlew deploy in terminal I get the attached error message.

Is there a fix for this?

User-iMac:myapp user$ ./gradlew deploy

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '9.0.4'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
User-iMac:myapp user$ ./gradlew deploy --debug
11:09:53.012 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: /Users/user/.gradle/native
11:09:53.055 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
11:09:53.055 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:09:53.055 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
11:09:53.056 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
11:09:53.059 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not determine java version from '9.0.4'.
11:09:53.059 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
11:09:53.059 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
11:09:53.059 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 
User-iMac:myapp user$

Hi Katrine,

Just making sure the basics are in place:

  • Did you install Java Development Kit (JDK) version 1.8 (Java 8) with update 92 or later?
  • Can you echo the contents of variable $XP_HOME in your terminal?
    echo $XP_HOME

It should look like a proper path, and going to it with cd should show you the contents of the home-folder in the XP installation.
cd $XP_HOME

It can look something like this the first time you do this command:

drwxr-xr-x@ 19 bobby  staff   608B Nov  6 08:30 config
drwxr-xr-x@ 10 bobby  staff   320B Feb 12 13:58 deploy
drwxr-xr-x   4 bobby  staff   128B Apr 28  2017 repo

Looks like you have Java 9 installed, which is not supported yet.
You should download and install Java 8 to run XP.

Select the operating system that applies in this page:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Any of the “Java SE Development Kit” options should work.

1 Like

We’ve updated the docs for setup of environment to reflect this. Thanks!

1 Like

So when will Java 9 be supported and will we be able to use es6 syntax out of the box. Since Java 9 supports it ?

Any ETA ?

//Runar

This is off-topic, what we plan to have Java 9 in XP 7.0, and then also support es6. No ETA yet, but when we know more we will communicate our plans.

This topic was automatically closed after 24 hours. New replies are no longer allowed.