4

Windows 10 Version 1607 (OS Build 14393.321)

I am getting following error while building our java project in command line

Error while executing process. Cannot run program "C:\Program Files\Java\jdk1.8.0_101\jre\bin\java": CreateProcess error=206, The filename or extension is too long

I have enabled 'Enable Win32 long paths' option under group policy

Computer Configuration > Administrative Templates > System > Filesystem

Restarted the system. But still getting same error.

Saagar
  • 794
  • 3
  • 20
  • 41
  • Ask the vendor of the tool, why they chose to limit the path name to 260 characters. You cannot change system settings to make this work. This is a bug in the software that calls `CreateProcess`. – IInspectable Oct 16 '16 at 13:41
  • @IInspectable `CreateProcess()` is a Win32 API function, and error 206 is `ERROR_FILENAME_EXCED_RANGE`. Per the documentation: "*The maximum length of [lpCommandLine] is 32,768 characters, including the Unicode terminating null character. If lpApplicationName is NULL, the module name portion of lpCommandLine is limited to MAX_PATH characters.*" – Remy Lebeau Oct 16 '16 at 17:37
  • @RemyLebeau: In other words: Don't pass NULL for *lpApplicationName*. – IInspectable Oct 16 '16 at 18:47
  • @IInspectable [What is the command line length limit?](https://blogs.msdn.microsoft.com/oldnewthing/20031210-00/?p=41553) – Remy Lebeau Oct 16 '16 at 20:30
  • @RemyLebeau: How is that related to your previous comment? – IInspectable Oct 16 '16 at 21:49
  • Can you provide more information? What are you using to build your project? What are your build settings? What is the command line that the build tool tries to execute? – andlabs Oct 18 '16 at 18:22
  • @andlabs- I am trying to build Java maven project in command prompt (DOS) using maven command ( mvn clean install -Dmaven.test.skip=true) – Saagar Oct 19 '16 at 04:27
  • You'll probably have to talk to the Maven folks then; there's a potential bug in it from what I see. Good luck. – andlabs Oct 21 '16 at 03:21

0 Answers0