Error new project

Error raise when I Create New Project:


[09:34:15.278] Loading sources for com.haulmont.cuba:cuba-rest-api:6.2.3
[09:34:18.695] Unexpected error
org.gradle.launcher.daemon.client.DaemonConnectionException: The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch: 
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jre1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6680,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=f29a8e04-6e48-4ee4-a834-eae06e23ac00,javaHome=C:\Program Files\Java\jdk1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6176,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]

[09:34:18.696] Exception has been thrown by com.haulmont.studio.backend.A@1827eaa:
[09:34:18.715] org.gradle.launcher.daemon.client.DaemonConnectionException: The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch: 
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jre1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6680,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=f29a8e04-6e48-4ee4-a834-eae06e23ac00,javaHome=C:\Program Files\Java\jdk1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6176,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
 
 at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemonWithId(DefaultDaemonConnector.java:136) 
 at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:116) 
 at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:90) 
 at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:123) 
 at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:80) 
 at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:58) 
 at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:40) 
 at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:60) 
 at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:34) 
 at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:132) 
 at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:108) 
 at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:168) 
 at org.gradle.tooling.internal.consumer.connection.CancellableModelBuilderBackedModelProducer.produceModel(CancellableModelBuilderBackedModelProducer.java:58) 
 at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:58) 
 ...
[09:34:20.833] Loading sources for com.haulmont.cuba:cuba-core:6.2.3
[09:34:21.638] Unexpected error
org.gradle.launcher.daemon.client.DaemonConnectionException: The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch: 
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jre1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6680,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=ea9a5eb1-1b0f-4572-a719-e10f1bc67ef9,javaHome=C:\Program Files\Java\jdk1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6716,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]

[09:34:21.639] Exception has been thrown by com.haulmont.studio.backend.A@1827eaa:
[09:34:21.640] org.gradle.launcher.daemon.client.DaemonConnectionException: The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch: 
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jre1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6680,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=ea9a5eb1-1b0f-4572-a719-e10f1bc67ef9,javaHome=C:\Program Files\Java\jdk1.8.0_101,daemonRegistryDir=C:\Users\Ricky\.gradle\daemon,pid=6716,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
 
 at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemonWithId(DefaultDaemonConnector.java:136) 
 at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:116) 
 at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:90) 
 at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:123) 
 at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:80) 
 at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:58) 
 at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:40) 
 at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:60) 
 at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:34) 
 at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:132) 
 at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:108) 
 at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:168) 
 at org.gradle.tooling.internal.consumer.connection.CancellableModelBuilderBackedModelProducer.produceModel(CancellableModelBuilderBackedModelProducer.java:58) 
 at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:58) 
 ...
[09:34:48.323] Loading sources for com.haulmont.cuba:cuba-portal:6.2.3
[09:34:49.865] Loading sources for com.haulmont.cuba:cuba-gui:6.2.3

What wrong??

Hi Ricky,

the error message says: “Java home is different”. I would assume that is has something to do with a difference in what “java -version” prints out and the path to that %JAVA_HOME% is set. You might have a look at this StackOverflow question.

Can you show what %JAVA_HOME% points to as well as what studio says in the studio server management ui?

Bye,
Mario

it set to javaHome=C:\Program Files\Java\jre1.8.0_101

Screenshot_3

Hi Ricky,

it looks like you are just using the Java runtime environment (JRE), not the Java Development toolkit (JDK).
Make sure that JDK is installed and used (see Installation and Setup - CUBA Platform. Developer’s Manual for more information about that). You can download the Oracle JDK here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

bye,
Mario

Thanks Mario, it solved now