Failed to generate JavaDoc: CreateProcess error=206, The filename or extension is too long

Answered

Greetings!

There is some annoying issue that I face when trying to generate Javadocs from InteliJ:

Error running Javadoc: Cannot run program "D:\jdk\bin\javadoc.exe": CreateProcess error=206, The filename or extension is too long

Probably, the command line that IDEA constructs is too long, but I don't see how I can workaround it. Tried to move JDK to shorter path (e.g. "D:\jdk") - same result.

Here is Javadoc Generation settings I use:

generate_javadoc_settings.jpg
And here is exception in the idea.log:

2013-11-05 15:16:29,903 [ 554289]   INFO - tion.impl.ExecutionManagerImpl - Cannot run program "C:\Program Files\Java\jdk1.7.0_45\bin\javadoc.exe": CreateProcess error=206, The filename or extension is too long
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "C:\Program Files\Java\jdk1.7.0_45\bin\javadoc.exe": CreateProcess error=206, The filename or extension is too long
    at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:239)
    at com.intellij.execution.process.DefaultJavaProcessHandler.<init>(DefaultJavaProcessHandler.java:34)
    at com.intellij.execution.configurations.JavaCommandLineStateUtil.startProcess(JavaCommandLineStateUtil.java:41)
    at com.intellij.execution.configurations.JavaCommandLineStateUtil.startProcess(JavaCommandLineStateUtil.java:34)
    at com.intellij.javadoc.JavadocConfiguration$MyJavaCommandLineState.startProcess(JavadocConfiguration.java:317)
    at com.intellij.javadoc.JavadocConfiguration$MyJavaCommandLineState.startProcess(JavadocConfiguration.java:132)
    at com.intellij.execution.configurations.CommandLineState.execute(CommandLineState.java:65)
    at com.intellij.execution.impl.DefaultJavaProgramRunner.doExecute(DefaultJavaProgramRunner.java:80)
    at com.intellij.execution.runners.GenericProgramRunner$1.execute(GenericProgramRunner.java:90)
    at com.intellij.execution.impl.ExecutionManagerImpl$2.run(ExecutionManagerImpl.java:212)
    at com.intellij.execution.impl.ExecutionManagerImpl.compileAndRun(ExecutionManagerImpl.java:188)
    at com.intellij.execution.impl.ExecutionManagerImpl.startRunProfile(ExecutionManagerImpl.java:250)
    at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:83)
    at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:62)
    at com.intellij.javadoc.JavadocGenerationManager.generateJavadoc(JavadocGenerationManager.java:86)
    at com.intellij.javadoc.actions.GenerateJavadocAction.analyze(GenerateJavadocAction.java:41)
    at com.intellij.analysis.BaseAnalysisAction.actionPerformed(BaseAnalysisAction.java:117)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:162)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:259)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:892)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:114)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:230)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:104)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:512)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:708)
    at java.awt.EventQueue$4.run(EventQueue.java:706)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:700)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:521)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_45\bin\javadoc.exe": CreateProcess error=206, The filename or extension is too long
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
    at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:235)
    ... 60 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:385)
    at java.lang.ProcessImpl.start(ProcessImpl.java:136)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
    ... 61 more


My configuration: Windows 7 x86_64, JDK 1.7.0_45, IDEA 12.1.6 UE.

How can I start IDEA with verbose logging enabled to see what command line it uses? Any hints how to resolve this issue in general? It is a real bloker for me now...

Thank you,
Dzmitry

9 comments
Official comment

If nothing is hidden, then you try to run javadoc for empty set of files, is it really your case?

What classpath do you pass to the command line when you start javadoc tool from command line? Seems that your project contains many dependencies and windows is unable to pass all of them in one command line. At the same time IDEA is unable to detect which one it should pass and which one - not.

Hi Dzmitry,

does javadic work for you from command line? What is hidden by the "Selected Files" scope?

Thanks

0

Of course, I checked that it works fine from the command line. Nothing is hidden under selected files.

BTW, I tried multiple options (e.g. Current File, Uncommited Files with some active Change List), and neither of them worked for me. Exception is the same all the time.

0

Anna, forget about Selected Files scope, I don't think it really matters. Let's say it fails (and it does) for Current File scope, and the only Java file is opened in the Editor.

I don't pass any classpath to the command line, just running something like this:

"C:\Program Files\Java\jdk1.7.0_45\bin\javadoc.exe" -d D:\downloads <FULL_PATH_TO_JAVA_FILE>

Also, I don't have CLASSPATH variable set on my env.

I understand that the problem is in the command IDEA builds. How I can get it to review WHY it is too long?

0

I was able to get the DEBUG log and found the command it tries to execute. Of course, it is too large because IDEA added a lot of stuf from local Maven repositorty to the classpath (see attached file).

You wrote that: "Seems that your project contains many dependencies and windows is unable to pass all of them in one command line. At the same time IDEA is unable to detect which one it should pass and which one - not.". Probably, it is the case. I tried to provide empty classpath using Other command line arguments, but seems like IDEA ignores it because of IDEA-38250.

What I can do to resolve/workaround this issue? I do want to generate the Javadocs from my IDE.

UPDATE: I've created IDEA-116083 to track this issue, because I could reproduce it on multiple projects, and I don't see a workaround.

Thank you,
Dmitry



Attachment(s):
debug_log.txt.zip
0

You can use Long Path Tool for this type of issue. It remove the error- 206 . It reduces your stress for long filename problem.

0

Hi, I experience the same problem as you but only Long path tool worked for me . I hope you try using it too . I hope it helps. :) 

0

Hi, I experienced the same issue and it worked for me when I removed unnecessary dependencies that I inserted before. I suggest you to comment out some dependencies and run this command "gradle clean build -xtest" if you are using gradle.

0

@Serhat Ataman if it is possible to have a sample project it would be great if you could provide one. Thanks.

0

Please sign in to leave a comment.