4

Jhipster 5.7 microservice failed to start on windows with error CreateProcess error=206, The filename or extension is too long

I have created a Jhipster micro service. when I am trying to start, I get error CreateProcess error=206, The filename or extension is too long. All other questions are suggesting to reduce classpath or usning IntelliJ. None of them explained how. Here are few things I have trying:

  1. Remove Unnecessary jar from classpath:

    • I have fresh Jhipsterap. I don't know which jar I can remove without breaking it.
  2. Use IntelliJ

    • I am running the service from command line.
  3. Move your project or maven repo to "c:" drive to make path short.

    • I can't. The repo is huge and is being shared.

Let me know if there is any other solution for this problem.

Thanks

Jose Loor
  • 205
  • 5
  • 18

2 Answers2

18

There is fairly simple way of reducing classpath on windows, if you can not move your local repo. Here is how:

Open command prompt and execute this command

mklink /J c:\repo C:\<long path to your maven repository>

This will create a link to your maven repository. Now run the service like this:

mvn -Dmaven.repo.local=c:\repo spring-boot:run

Thats all. Now your classpath will be reduced by around 10000 characters (tried for jhipster gateway app).

Good luck.

Agam
  • 1,015
  • 2
  • 11
  • 21
1

Forking is enabled by default since Spring Boot 2.2. See Since 2.2.0 spring-boot-maven-plugin create 2 java process (may cause CreateProcess error=206). Need workaround to fix it question and solution

Grigory Kislin
  • 16,647
  • 10
  • 125
  • 197
  • Disabling forking will disable some features such as an agent, custom JVM arguments, devtools or specifying the working directory to use. But thanks for finding this this option. – Agam Apr 10 '20 at 03:24