CommandNotFoundException: No valid executable found

Stacktrace:

2023-11-17T13:40:12.117+01:00 ERROR 22572 --- [io-8080-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [com.vaadin.flow.server.Service
Exception: java.lang.IllegalStateException: com.vaadin.flow.server.ExecutionFailedException: Failed to configure Hilla engine] with root cause

dev.hilla.engine.commandrunner.CommandNotFoundException: No valid executable found
at dev.hilla.engine.commandrunner.CommandRunner.lambda$run$0(CommandRunner.java:72) ~[engine-core-2.3.2.jar!/:na]
at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[na:na]
at dev.hilla.engine.commandrunner.CommandRunner.run(CommandRunner.java:72) ~[engine-core-2.3.2.jar!/:na]
at dev.hilla.internal.AbstractTaskEndpointGenerator.prepareEngineConfiguration(AbstractTaskEndpointGenerator.java:87) ~[engine-runtime-2.3.2.jar!/:na]
at dev.hilla.internal.AbstractTaskEndpointGenerator.getEngineConfiguration(AbstractTaskEndpointGenerator.java:59) ~[engine-runtime-2.3.2.jar!/:na]
at dev.hilla.internal.TaskGenerateOpenAPIImpl.execute(TaskGenerateOpenAPIImpl.java:73) ~[engine-runtime-2.3.2.jar!/:na]
at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:312) ~[flow-server-24.2.0.jar!/:24.2.0]
at com.vaadin.base.devserver.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:352) ~[vaadin-dev-server-24.2.0.jar!/:na]
at com.vaadin.base.devserver.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:293) ~[vaadin-dev-server-24.2.0.jar!/:na]

Looks like it can not find mvn on your PATH, or the mvnw wrapper in the current folder.

I can see a similar issue on my environment when starting the application from the IDE and not having a maven wrapper (or having the Hilla application in a maven submodule, so the wrapper is in a parent folder)
This happens to me because, I have maven managed by sdkman so IDEA cannot find it in the PATH, as Sascha said

Anyway, it would be nice to be able to provide an additional executable for MavenRunner as a system property

@versatile-zorse, if you can, please consider opening a ticket about sdkman incompatibility with Hilla.

my two cent here. In my case I have a multi-module gradle project and the gradlew is at the top level, while the vaading application is one of the submodules

Hi, this issue should be solved in Vaadin 24.7 as we no longer need to run Gradle or Maven at each code change.