CreateProcess error=206, The filename or extension is too long

To solve this issue, community plug in doesn’t helped me.

Is there any solution to fix this issue, due to this I can not able to build application. I’m using jdk 1.8 and gradle 4.4.1

Caused by: java.io.IOException: Cannot run program “C:\Program Files\Java\jdk1.8.0_241\jre\bin\java.exe” CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

With that version of Gradle you need to build a pathingJar. Here’s a link on how to do it https://stackoverflow.com/questions/5434482/how-can-i-create-a-pathing-jar-in-gradle

If you upgradle to 6.0 then the issue will be fixed for you https://docs.gradle.org/6.0/release-notes.html#usability-improvements

Use of the com.github.ManifestClasspath fixed the issue for me:

Hi, i use gradle 6.1.1 and now i see error

Execution failed for task ‘:project:kaptGenerateStubsKotlin’
java.io.IOException: Cannot run program “C:\Program Files\java\jdk-11.0.9.1+1\bin\java”: CreateProcess error=206 The filename or extension is too long

it happens if i try to add my custom plugin.
How can i solve this problem? may be i can debug it and see long path?
debug.xml (1.0 MB)

Hey, had the same error. I’m using gradle 5.3
Just solved the error by updating my intellij to version 2021.1.2.