Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CreateProcess error=206, The filename or extension is too long when running main() method

Tags:

java

eclipse

There is no simple (as in a couple of clicks or a simple command) solution to this issue.

Quoting from some answers in this bug report in Eclipse.org, these are the work-arounds. Pick the one that's the least painful to you:

  • Reduce the classpath
  • Use directories instead of jar files
  • Use a packed jar files which contains all other jars, use the classpath variable inside the manifest file to point to the other jars
  • Use a special class loader which reads the classpath from a config file
  • Try to use one of the attached patches in the bug report document
  • Use an own wrapper e.g. ant

Update: After July 2014, there is a better way (thanks to @Brad-Mace's answer below:

If you have created your own build file instead of using Project -> Generate Javadocs, then you can add useexternalfile="yes" to the Javadoc task, which is designed specifically to solve this problem.


If you create your own build file rather than using Project -> Generate Javadocs you can add useexternalfile="yes" to the javadoc task, which is designed specifically to solve this problem.


I faced this problem today and I was able to solve it using this Gradle plugin

It's github url is this

IF you, like me, have no idea what Gradle is but need to run a backend to do your front end work, what you need to do is find the build.gradle file that is being called to start your BE server and add this to the top:

plugins {
  id "ua.eshepelyuk.ManifestClasspath" version "1.0.0"
}

**enter image description here**

In intellij there is an option to 'shorten command line', select 'JAR manifest' or '@argFiles' would solve the problem, basically it will put your lengthy class path into a jar file or a temp file


I was running into this issue trying to execute a JPQL query in the Hibernate / JPA console of IntelliJ 2020.2

Adding this to my .idea/workspace.xml fixed it

<component name="PropertiesComponent">
 
...
     <property name="dynamic.classpath" value="true"/>
 
...
 
</component>

Origin of the solution: https://youtrack.jetbrains.com/issue/IDEA-166929?_ga=2.167622078.1290412178.1604511702-23036228.1574844686