IllegalStateException: Cannot find the system Java compiler. Check that your class path includes tools.jar

Hi everybody,

I get this following problem:

java.lang.IllegalStateException: Cannot find the system Java compiler. Check that your class path includes tools.jar
	at com.haulmont.cuba.core.sys.javacl.compiler.CharSequenceCompiler.<init>(CharSequenceCompiler.java:68)
	at com.haulmont.cuba.core.sys.javacl.JavaClassLoader.createCompiler(JavaClassLoader.java:262)
	at com.haulmont.cuba.core.sys.javacl.JavaClassLoader.loadClass(JavaClassLoader.java:140)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677)
	at com.haulmont.cuba.core.sys.AbstractScripting$CubaGroovyClassLoader.loadClass(AbstractScripting.java:475)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:545)
	at com.haulmont.cuba.core.sys.AbstractScripting.loadClass(AbstractScripting.java:280)
	at com.haulmont.cuba.gui.WindowManager.preloadMainScreenClass(WindowManager.java:606)
	at com.haulmont.cuba.gui.WindowManager.createWindow(WindowManager.java:554)
	at com.haulmont.cuba.gui.WindowManager.openEditor(WindowManager.java:866)
	at com.haulmont.cuba.web.WebWindowManager.openEditor(WebWindowManager.java:167)
	at com.haulmont.cuba.gui.components.WindowDelegate.openEditor(WindowDelegate.java:258)
	at com.haulmont.cuba.web.gui.WebWindow.openEditor(WebWindow.java:483)
	at com.haulmont.cuba.gui.components.actions.CreateAction.internalOpenEditor(CreateAction.java:305)
	at com.haulmont.cuba.gui.components.actions.CreateAction.actionPerform(CreateAction.java:265)
	at com.haulmont.cuba.web.gui.components.WebButton.performAction(WebButton.java:44)
	at com.haulmont.cuba.web.gui.components.WebButton.lambda$new$61446b05$1(WebButton.java:36)

I checked my settings, and my Java_Home use the right java-jdk and it includes the tools.jar in the directory lib.

Does anybody have an hint for me? How to fix it?

I do this tutorial:

and it happens, when I open Oderstatus, click on create, then the exception appears…

FIXED:

The solution was:
when you start cuba studio, on your browser will appear “project settings”, you should write the java path into it. My path was to jre instead of the jdk in the project settings.

So keep attention on it :wink: