Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I get the titled error when I use jvmarguments in the pom file. I'm using mvnw command with the below plugin to enable debugging. If I remove the jvm argument, it works. But I want to enable remote debugging with the mvnw command

Code Snippet:

<plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
            <execution>
                <goals>
                    <goal>repackage</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <mainClass>${start-class}</mainClass>
            <executable>true</executable>
            <fork>true</fork>
            <jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments> 
        </configuration>
</plugin>

Error:

*[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.7.RELEASE:run (default-cli) on project dxcgateway: Could not exec java: Cannot run program "C:\Program Files\Java\jdk1.8.0_202\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.7.RELEASE:run (default-cli) on project dxcg ateway: Could not exec java

Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_202\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048) at org.springframework.boot.loader.tools.RunProcess.run (RunProcess.java:77)

Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_202\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048) at org.springframework.boot.loader.tools.RunProcess.run (RunProcess.java:77)*

like image 536
Developer404 Avatar asked Jan 27 '23 02:01

Developer404


2 Answers

change

<fork>true</fork>

to

<fork>false</fork>
like image 140
ALAOUI Jaouhar Avatar answered Jan 30 '23 05:01

ALAOUI Jaouhar


If you are using IntelliJ Idea platform just change the launch configuration to avoid using the default shorten line

enter image description here

This worked for me.

like image 30
Trushit Shekhda Avatar answered Jan 30 '23 03:01

Trushit Shekhda