I'm trying to run my project in IntelliJ IDEA in debug or run mode, and it is throwing me always this: Cannot run program "C:\corretto11\bin\java.exe" (in directory "C:\project-be"): CreateProcess error=206, The filename or extension is too long I have both in C root, I tried to google it and search in Stack Overflow, but nothing that I found was working. EDIT: The problem comes when I add the following dependency:
To be honest, no idea what could I do, if I remove the dependency it works like magic. asked Sep 29, 2021 at 12:59 8 In addition to changing the run configuration, you must also enable this in your workspace. It's quite silly that this is still required, and not enabled by default. Open the file
and add the following:
answered Oct 5, 2021 at 10:28 NathanNathan 1,00711 silver badges16 bronze badges 3 It works for me in intellij: Run -> Edit Configurations -> Modify options -> Shorten command line -> and select last option from Shorten command line (@argfile(Java9+)) answered Jan 19, 2022 at 12:14 In addition to Nathan answer. In most recent versions, Intellij uses a Json in Add the answered Nov 25, 2022 at 18:23 z1lV3rz1lV3r 7797 silver badges13 bronze badges 2 In Idea
0. Chose
1 and in
2 drop down select
3 or
4 Shorten command line drop down answered Jul 18, 2023 at 11:00 this is how I solved this error, if you you are using windows Follow these Steps
answered Oct 18, 2022 at 11:40 Khalid HabibKhalid Habib 1,1281 gold badge16 silver badges25 bronze badges 1 After several days of struggling with the problem, I eventually found a solution. By enabling debug logs, I discovered that the characters in the classpath were exceeding the maximum limit of around 32k on Windows. The directory with the maximum entries in the classpath was the .m2 folder directory, which was stored in my user/{username} directory, taking up a significant chunk of characters.(use an online string analyser tool for this) To resolve the issue, I redirected the .m2 repository to "C:" which reduced the classpath to approximately 30k characters, and the problem was resolved. My suggestion to others facing a similar issue would be to analyze the classpath and find ways to reduce its size. Unfortunately, there is no universal solution that works for all cases. |