[JAVA] Run-app with grails no longer boots

Introduction

Hello, it's engineers are making many things in grails.

Event

One day, when I added a dependency and started grails, it didn't even boot like this.

load application.groovy
| Resolving Dependencies. Please wait...

CONFIGURE SUCCESSFUL

| Running application...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_201\bin\java.exe''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
| Error Failed to start server (Use --stacktrace to see the full trace)

When I add --stacktrace and start it again,

Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_201\bin\java.exe" (in directory "D:\git_repo\puredash"): CreateProcess error=206,The file name or extension is too long.
        at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
        ... 5 more
Caused by: java.io.IOException: CreateProcess error=206,The file name or extension is too long.
        ... 6 more
| Error Failed to start server

That is a fragrant error. What's the longest part of "D: \ git_repo \ puredash"! I thought, but apparently I wrote a lot of dependencies, so it seems that the cause is that the classpath is too long and the command line is too long. In such a case, add this to build.gradle.

grails {
	pathingJar = true
}

At first, there seems to be a similar case in the gradle area (obviously), and if I write various things, there is already a pathingJar task? I got an error like this, so I tried only the above. By the way, it's grails-3.3.9. Let's do our best again, everyone.

reference

[Gradle] Dealing with Createprocess error = 206 [Note]

Recommended Posts

Run-app with grails no longer boots
Java 9 no longer needs add-apt-repository