Idea createprocess error 206 имя файла или его расширение имеет слишком большую длину

I have this error in eclipse helios: Exception occurred executing command line. Cannot run program "C:Program Files (x86)Javajre6binjavaw.exe" (in directory "C:Usersmotiverhelios_workspace

I have this error in eclipse helios:

Exception occurred executing command line.
Cannot run program «C:Program Files (x86)Javajre6binjavaw.exe» (in directory «C:Usersmotiverhelios_workspaceTimeTracker»): CreateProcess error=206, The filename or extension is too long

I researched a bit but most of the issues were related to DataNucleus when working on Google App Engine. But I am not using anything remotely related to Google App Engine. I am doing a small project with Servlet 3.0 on JBOSS 6. I am using Hibernate 4.1.2 for ORM and RESTEasy to expose a web service. I created a util file that has a main() method that basically drops and re-creates the schema. I run the main() methos when I need a clean database for testing purposes. It worked fine on Tomcat 7 but it stopped working when I moved to JBoss 6.

Any hint or solution would be greatly appreciated.

BalusC's user avatar

BalusC

1.1m370 gold badges3585 silver badges3539 bronze badges

asked May 9, 2012 at 15:49

motiver's user avatar

4

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.

Favour Felix Chinemerem's user avatar

answered May 15, 2012 at 9:42

espinchi's user avatar

espinchiespinchi

9,0146 gold badges57 silver badges65 bronze badges

8

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"
}

answered Jun 8, 2018 at 13:53

Alejandro B.'s user avatar

Alejandro B.Alejandro B.

4,7272 gold badges38 silver badges60 bronze badges

3

**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

answered Feb 10, 2020 at 5:06

actan's user avatar

actanactan

5872 gold badges7 silver badges17 bronze badges

2

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.

answered Apr 25, 2014 at 17:47

Brad Mace's user avatar

Brad MaceBrad Mace

27k17 gold badges99 silver badges146 bronze badges

2

Answering my own question here so that the solution doesn’t get buried in comments. I exported the project as a runnable jar from within eclipse and did a command line «java -jar MyJar.jar» and it works perfectly fine

answered May 15, 2012 at 22:18

motiver's user avatar

motivermotiver

2,1824 gold badges18 silver badges20 bronze badges

This is not specifically for eclipse, but the way I got around this was by creating a symbolic link to my maven repository and pointing it to something like «C:R». Then I added the following to my settings.xml file:

<localRepository>C:R</localRepository>

The maven repository path was contributing to the length problems in my windows machine.

answered Jan 31, 2019 at 1:00

Shygar's user avatar

ShygarShygar

1,1438 silver badges10 bronze badges

Question is old, but still valid. I come across this situation often whenever a new member joins my team or a new code segment is added to existing code. Simple workaround we follow is to «Reduce the classpath» by moving up the directories.

As question mentioned, this is not specific to eclipse. I came across this issue in IntelliJ Idea 14 and 2018 as well.

After a long research, I found the solution is to set the

fork = false

in javc of ant build file.

<javac destdir="${build.dir}" fork="false" debug="on">
    <classpath .../>
    <src ... />
    <patternset ... />
</javac>

This is how my ant build javac looks now. To learn about more on fork, please refer ant documentation.

answered Jan 2, 2019 at 6:54

Don D's user avatar

Don DDon D

7261 gold badge9 silver badges19 bronze badges

0

In bug report Bug 327193 it is considered fixed, but it happen to me recently with Eclipse Kepler 4.3.2.

Please download patch for Eclipse Juno or newer:

https://bugs.eclipse.org/bugs/attachment.cgi?id=216593

  1. After download back up existing
    eclipse/plugins/org.eclipse.jdt.launching_3.*.jar
  2. Copy and paste classes in the patch to org.eclipse.jdt.launching JAR
    (replace existing files).
  3. Restart Eclipse.

answered May 22, 2014 at 19:52

Maciej Dzikowicki's user avatar

2

How many people sad above, there are a lot of plugins to gradle execute a by pass in this problem like:

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

or

plugins {
  id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}

But the better solution that I found was kill the JVM process and everything is done.

answered Aug 7, 2020 at 19:21

Ivan Rodrigues's user avatar

1

Try adding this in build.gradle (gradle version 4.10.x) file and check it out com.xxx.MainClass this is the class where your main method resides:

plugins {
  id "ua.eshepelyuk.ManifestClasspath" version "1.0.0"
}
apply plugin: 'application'
application {
    mainClassName = "com.xxx.MainClass"
}

The above change must resolve the issue, there is another way using script run.sh below could fix this issue, but it will be more of command-line fix, not in IntelliJ to launch gradle bootRun.

answered Mar 9, 2020 at 12:33

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

2

Try this:

java -jar -Dserver.port=8080 build/libs/APP_NAME_HERE.jar

answered Apr 6, 2017 at 17:44

user3272405's user avatar

To solve it:

If you are using Eclipse:

Move .m2 repository to

c:
Go to Eclipse > Windows/Preferences/Maven/User Settings -> Create your own setting.xml with its content:

<settings>
  <localRepository>c:/.m2/repository</localRepository>
</settings>

If you are using IntelliJ:
Go to IntelliJ > clicking the right mouse button on «pom.xml» > maven > create «settings.xml»

with its content:

<settings>
      xmlns="yourcontent"
      xmlns:xsi="yourcontent"
      xsi:schemaLocation="yourcontent.xsd">
  <localRepository>c:/.m2/repository</localRepository>
</settings>

answered May 31, 2019 at 10:00

R. Pereira's user avatar

R. PereiraR. Pereira

1751 gold badge2 silver badges9 bronze badges

In my case the error was showing because system java version was different from intellijj/eclipse java version. System and user had diff java versions. If you compile your code using one version and tried to run using a different version, it will error out.
User java version is 1.8

#The system java version is 1.7.131
$ java -version
java version "1.7.0_131"

Long story short, make sure your code is compiled and ran by the same java version.

answered Jun 20, 2019 at 1:34

z atef's user avatar

z atefz atef

6,7523 gold badges52 silver badges48 bronze badges

I am using legacy version of gradle plugins and this plugin solved the issue for me.

Usage (check source for more details):

Build script snippet for plugins DSL for Gradle 2.1 and later

plugins {
  id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}

Build script snippet for use in older Gradle versions or where dynamic
configuration is required

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.github.viswaramamoorthy:gradle-util-plugins:0.1.0-RELEASE"
  }
}

apply plugin: "com.github.ManifestClasspath"

answered May 6, 2020 at 13:08

Ilkin's user avatar

IlkinIlkin

3763 silver badges17 bronze badges

I have got same error, while invoking Maven.

The root cause for my problem was the classpath was very huge. Updating the classpath fixed the problem.

There are multiple ways to update the large classpath as mentioned in this: How to set a long Java classpath in Windows?

  1. Use wildcards
  2. Argument File
  3. Pathing jar

Since I am using Intellij, they provide the option to use Argument File that i used.

answered Jan 6, 2015 at 20:44

Sandeep Jindal's user avatar

Sandeep JindalSandeep Jindal

14.1k18 gold badges83 silver badges121 bronze badges

3

In a Windows machine, there is a limitation of the jar file name/path length in the command-line, due to which you see the below error message, I tried searching a lot, even I tried applying the above solution, some reason, it didn’t work, I found the working snippet for Gradle (gradle-4.10.2-all.zip)

Error:

CreateProcess error=206, The filename or extension is too long

Use this below gradle.build code snippet to fix the above problem in IntelliJ or STS, or eclipse anything.

Gradle Code Fix:

apply plugin: 'application'

task pathingJar(type: Jar) {
    dependsOn configurations.runtime
    appendix = 'pathing'

    doFirst {
        manifest {
            attributes "Class-Path": configurations.runtimeClasspath.files.collect { it.getName() }.join(' ')
        }
    }
}

task copyToLib(type: Copy) {
    into "$buildDir/libs"
    from configurations.runtime
}

bootRun {
    systemProperties = System.properties
    //This below line is for if you have different profiles prod, dev etc...
    //systemProperty 'spring.profiles.active', 'dev'
    jvmArgs('-Djava.util.logging.config.file=none')
    mainClassName = "com.xxxx.Main"
    dependsOn pathingJar
    dependsOn copyToLib
    doFirst {
        classpath = files("$buildDir/classes/java/main", "$buildDir/resources/main", pathingJar.archivePath)
    }
}

answered Jul 8, 2020 at 17:26

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

If you are using VSCode:

  1. create launch.json file insde .vscode/

  2. add

    {"configurations": [{ "type": "java","shortenCommandLine ": "auto",}]}
    

If you are using intellij :

  1. open .idea/workspace.xml

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

Suraj Rao's user avatar

Suraj Rao

29.3k11 gold badges96 silver badges103 bronze badges

answered Jan 12, 2022 at 14:31

mans.luv.2.code's user avatar

it happens due to DataNucleus sometimes overwrite the Arguments with many paths.

You have to overwrite them with this:

-enhancerName ASM -api JDO -pu MediaToGo

Hope help you!

answered May 2, 2013 at 14:55

Rodrigohsb's user avatar

I got the same error. Tried solutions like cleaning, rebuild, invalidateCache, retart etc but nothing works.

I just have created a new folder with short name and copied all the files(app folder, gradle files etc) in new folder. Opened application in android studio and its working fine.

answered Oct 31, 2018 at 10:39

Tara's user avatar

TaraTara

2,5701 gold badge20 silver badges30 bronze badges

For me it was wrong JDK path. Please make sure you have right path to the JDK file

File -> Project Structure

enter image description here

answered Mar 17, 2021 at 5:46

Muhammad Hamza Shahid's user avatar

If you are using Android Studio try Invalidate Caches/ Restart.. option present in File menu

answered Jun 5, 2021 at 10:26

SagaRock101's user avatar

m4n0's user avatar

m4n0

28.6k26 gold badges74 silver badges89 bronze badges

answered Sep 15, 2021 at 6:15

Naeem Ghumman's user avatar

To fix this below error, I did enough research, not got any great solution, I prepared this script and it is working fine, thought to share to the public and make use of it and save there time.

CreateProcess error=206, The filename or extension is too long

If you are using the Gradle build tool, and the executable file is placed in build/libs directory of your application.
run.sh -> create this file in the root directory of your project, and copy below script in it, then go to git bash and type run.sh then enter. Hope this helps!

#!/bin/bash
dir_name=`pwd`
if [ $# == 1 ] && [ $1 == "debug" ]
then
    port=$RANDOM
    quit=0
    echo "Finding free port for debugging"
    while [ "$quit" -ne 1 ]; do
        netstat -anp | grep $port >> /dev/null
        if [ $? -gt 0 ]; then
            quit=1
        else
            port=`expr $port + 1`
        fi
    done
    echo "Starting in Debug Mode on "$port
    gradle clean bootjar
    jar_name="build/libs/"`ls -l ./build/libs/|grep jar|grep -v grep|awk '{print $NF}'`
    #java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$port $jar_name 
elif [ $# == 1 ] && [ $1 == 'help' ]
then
    echo "please use this commands"
    echo "------------------------"
    echo "Start in Debug Mode: sh run.sh debug"
        echo "Start in Run Mode: sh run.sh" 
    echo "------------------------"
else
    gradle clean bootjar
    word_count=`ls -l ./build/libs/|grep jar|grep -v grep|wc -w`
    jar_name=`ls -l ./build/libs/|grep jar|grep -v grep|awk '{print $NF}'`  
    jar_path=build/libs/$jar_name
    echo $jar_name
    #java -jar $jar_path
fi

Hope this helps!!

TomasZ.'s user avatar

TomasZ.

4395 silver badges10 bronze badges

answered Mar 9, 2020 at 12:07

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

You can use below commands:

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


mvn -Dmaven.repo.local=c:repo any mvn command

answered May 17, 2022 at 12:15

Nirbhay Rana's user avatar

Nirbhay RanaNirbhay Rana

4,1612 gold badges18 silver badges4 bronze badges

Valid answer from this thread was the right answer for my special case.
Specify the ORM folder path for datanucleus certainly reduce the java path compile.

https://stackoverflow.com/a/1219427/1469481

Community's user avatar

answered Nov 2, 2013 at 14:45

smora's user avatar

smorasmora

6975 silver badges18 bronze badges

I got the error below when I run ‘ant deploy

Cannot run program "C:javajdk1.8.0_45binjava.exe": CreateProcess error=206, The filename or extension is too long

Fixed it by run ‘ant clean‘ before it.

answered Feb 4, 2016 at 0:46

maoyang's user avatar

maoyangmaoyang

1,0271 gold badge11 silver badges11 bronze badges

2

I got the same error in android studio. I was able to resolve it by running Build->Clean Project in the IDE.

mhatch's user avatar

mhatch

4,3256 gold badges36 silver badges60 bronze badges

answered Jun 13, 2017 at 9:28

Kiran's user avatar

KiranKiran

3782 silver badges15 bronze badges

0

I have this error in eclipse helios:

Exception occurred executing command line.
Cannot run program «C:Program Files (x86)Javajre6binjavaw.exe» (in directory «C:Usersmotiverhelios_workspaceTimeTracker»): CreateProcess error=206, The filename or extension is too long

I researched a bit but most of the issues were related to DataNucleus when working on Google App Engine. But I am not using anything remotely related to Google App Engine. I am doing a small project with Servlet 3.0 on JBOSS 6. I am using Hibernate 4.1.2 for ORM and RESTEasy to expose a web service. I created a util file that has a main() method that basically drops and re-creates the schema. I run the main() methos when I need a clean database for testing purposes. It worked fine on Tomcat 7 but it stopped working when I moved to JBoss 6.

Any hint or solution would be greatly appreciated.

BalusC's user avatar

BalusC

1.1m370 gold badges3585 silver badges3539 bronze badges

asked May 9, 2012 at 15:49

motiver's user avatar

4

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.

Favour Felix Chinemerem's user avatar

answered May 15, 2012 at 9:42

espinchi's user avatar

espinchiespinchi

9,0146 gold badges57 silver badges65 bronze badges

8

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"
}

answered Jun 8, 2018 at 13:53

Alejandro B.'s user avatar

Alejandro B.Alejandro B.

4,7272 gold badges38 silver badges60 bronze badges

3

**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

answered Feb 10, 2020 at 5:06

actan's user avatar

actanactan

5872 gold badges7 silver badges17 bronze badges

2

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.

answered Apr 25, 2014 at 17:47

Brad Mace's user avatar

Brad MaceBrad Mace

27k17 gold badges99 silver badges146 bronze badges

2

Answering my own question here so that the solution doesn’t get buried in comments. I exported the project as a runnable jar from within eclipse and did a command line «java -jar MyJar.jar» and it works perfectly fine

answered May 15, 2012 at 22:18

motiver's user avatar

motivermotiver

2,1824 gold badges18 silver badges20 bronze badges

This is not specifically for eclipse, but the way I got around this was by creating a symbolic link to my maven repository and pointing it to something like «C:R». Then I added the following to my settings.xml file:

<localRepository>C:R</localRepository>

The maven repository path was contributing to the length problems in my windows machine.

answered Jan 31, 2019 at 1:00

Shygar's user avatar

ShygarShygar

1,1438 silver badges10 bronze badges

Question is old, but still valid. I come across this situation often whenever a new member joins my team or a new code segment is added to existing code. Simple workaround we follow is to «Reduce the classpath» by moving up the directories.

As question mentioned, this is not specific to eclipse. I came across this issue in IntelliJ Idea 14 and 2018 as well.

After a long research, I found the solution is to set the

fork = false

in javc of ant build file.

<javac destdir="${build.dir}" fork="false" debug="on">
    <classpath .../>
    <src ... />
    <patternset ... />
</javac>

This is how my ant build javac looks now. To learn about more on fork, please refer ant documentation.

answered Jan 2, 2019 at 6:54

Don D's user avatar

Don DDon D

7261 gold badge9 silver badges19 bronze badges

0

In bug report Bug 327193 it is considered fixed, but it happen to me recently with Eclipse Kepler 4.3.2.

Please download patch for Eclipse Juno or newer:

https://bugs.eclipse.org/bugs/attachment.cgi?id=216593

  1. After download back up existing
    eclipse/plugins/org.eclipse.jdt.launching_3.*.jar
  2. Copy and paste classes in the patch to org.eclipse.jdt.launching JAR
    (replace existing files).
  3. Restart Eclipse.

answered May 22, 2014 at 19:52

Maciej Dzikowicki's user avatar

2

How many people sad above, there are a lot of plugins to gradle execute a by pass in this problem like:

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

or

plugins {
  id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}

But the better solution that I found was kill the JVM process and everything is done.

answered Aug 7, 2020 at 19:21

Ivan Rodrigues's user avatar

1

Try adding this in build.gradle (gradle version 4.10.x) file and check it out com.xxx.MainClass this is the class where your main method resides:

plugins {
  id "ua.eshepelyuk.ManifestClasspath" version "1.0.0"
}
apply plugin: 'application'
application {
    mainClassName = "com.xxx.MainClass"
}

The above change must resolve the issue, there is another way using script run.sh below could fix this issue, but it will be more of command-line fix, not in IntelliJ to launch gradle bootRun.

answered Mar 9, 2020 at 12:33

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

2

Try this:

java -jar -Dserver.port=8080 build/libs/APP_NAME_HERE.jar

answered Apr 6, 2017 at 17:44

user3272405's user avatar

To solve it:

If you are using Eclipse:

Move .m2 repository to

c:
Go to Eclipse > Windows/Preferences/Maven/User Settings -> Create your own setting.xml with its content:

<settings>
  <localRepository>c:/.m2/repository</localRepository>
</settings>

If you are using IntelliJ:
Go to IntelliJ > clicking the right mouse button on «pom.xml» > maven > create «settings.xml»

with its content:

<settings>
      xmlns="yourcontent"
      xmlns:xsi="yourcontent"
      xsi:schemaLocation="yourcontent.xsd">
  <localRepository>c:/.m2/repository</localRepository>
</settings>

answered May 31, 2019 at 10:00

R. Pereira's user avatar

R. PereiraR. Pereira

1751 gold badge2 silver badges9 bronze badges

In my case the error was showing because system java version was different from intellijj/eclipse java version. System and user had diff java versions. If you compile your code using one version and tried to run using a different version, it will error out.
User java version is 1.8

#The system java version is 1.7.131
$ java -version
java version "1.7.0_131"

Long story short, make sure your code is compiled and ran by the same java version.

answered Jun 20, 2019 at 1:34

z atef's user avatar

z atefz atef

6,7523 gold badges52 silver badges48 bronze badges

I am using legacy version of gradle plugins and this plugin solved the issue for me.

Usage (check source for more details):

Build script snippet for plugins DSL for Gradle 2.1 and later

plugins {
  id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}

Build script snippet for use in older Gradle versions or where dynamic
configuration is required

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.github.viswaramamoorthy:gradle-util-plugins:0.1.0-RELEASE"
  }
}

apply plugin: "com.github.ManifestClasspath"

answered May 6, 2020 at 13:08

Ilkin's user avatar

IlkinIlkin

3763 silver badges17 bronze badges

I have got same error, while invoking Maven.

The root cause for my problem was the classpath was very huge. Updating the classpath fixed the problem.

There are multiple ways to update the large classpath as mentioned in this: How to set a long Java classpath in Windows?

  1. Use wildcards
  2. Argument File
  3. Pathing jar

Since I am using Intellij, they provide the option to use Argument File that i used.

answered Jan 6, 2015 at 20:44

Sandeep Jindal's user avatar

Sandeep JindalSandeep Jindal

14.1k18 gold badges83 silver badges121 bronze badges

3

In a Windows machine, there is a limitation of the jar file name/path length in the command-line, due to which you see the below error message, I tried searching a lot, even I tried applying the above solution, some reason, it didn’t work, I found the working snippet for Gradle (gradle-4.10.2-all.zip)

Error:

CreateProcess error=206, The filename or extension is too long

Use this below gradle.build code snippet to fix the above problem in IntelliJ or STS, or eclipse anything.

Gradle Code Fix:

apply plugin: 'application'

task pathingJar(type: Jar) {
    dependsOn configurations.runtime
    appendix = 'pathing'

    doFirst {
        manifest {
            attributes "Class-Path": configurations.runtimeClasspath.files.collect { it.getName() }.join(' ')
        }
    }
}

task copyToLib(type: Copy) {
    into "$buildDir/libs"
    from configurations.runtime
}

bootRun {
    systemProperties = System.properties
    //This below line is for if you have different profiles prod, dev etc...
    //systemProperty 'spring.profiles.active', 'dev'
    jvmArgs('-Djava.util.logging.config.file=none')
    mainClassName = "com.xxxx.Main"
    dependsOn pathingJar
    dependsOn copyToLib
    doFirst {
        classpath = files("$buildDir/classes/java/main", "$buildDir/resources/main", pathingJar.archivePath)
    }
}

answered Jul 8, 2020 at 17:26

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

If you are using VSCode:

  1. create launch.json file insde .vscode/

  2. add

    {"configurations": [{ "type": "java","shortenCommandLine ": "auto",}]}
    

If you are using intellij :

  1. open .idea/workspace.xml

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

Suraj Rao's user avatar

Suraj Rao

29.3k11 gold badges96 silver badges103 bronze badges

answered Jan 12, 2022 at 14:31

mans.luv.2.code's user avatar

it happens due to DataNucleus sometimes overwrite the Arguments with many paths.

You have to overwrite them with this:

-enhancerName ASM -api JDO -pu MediaToGo

Hope help you!

answered May 2, 2013 at 14:55

Rodrigohsb's user avatar

I got the same error. Tried solutions like cleaning, rebuild, invalidateCache, retart etc but nothing works.

I just have created a new folder with short name and copied all the files(app folder, gradle files etc) in new folder. Opened application in android studio and its working fine.

answered Oct 31, 2018 at 10:39

Tara's user avatar

TaraTara

2,5701 gold badge20 silver badges30 bronze badges

For me it was wrong JDK path. Please make sure you have right path to the JDK file

File -> Project Structure

enter image description here

answered Mar 17, 2021 at 5:46

Muhammad Hamza Shahid's user avatar

If you are using Android Studio try Invalidate Caches/ Restart.. option present in File menu

answered Jun 5, 2021 at 10:26

SagaRock101's user avatar

m4n0's user avatar

m4n0

28.6k26 gold badges74 silver badges89 bronze badges

answered Sep 15, 2021 at 6:15

Naeem Ghumman's user avatar

To fix this below error, I did enough research, not got any great solution, I prepared this script and it is working fine, thought to share to the public and make use of it and save there time.

CreateProcess error=206, The filename or extension is too long

If you are using the Gradle build tool, and the executable file is placed in build/libs directory of your application.
run.sh -> create this file in the root directory of your project, and copy below script in it, then go to git bash and type run.sh then enter. Hope this helps!

#!/bin/bash
dir_name=`pwd`
if [ $# == 1 ] && [ $1 == "debug" ]
then
    port=$RANDOM
    quit=0
    echo "Finding free port for debugging"
    while [ "$quit" -ne 1 ]; do
        netstat -anp | grep $port >> /dev/null
        if [ $? -gt 0 ]; then
            quit=1
        else
            port=`expr $port + 1`
        fi
    done
    echo "Starting in Debug Mode on "$port
    gradle clean bootjar
    jar_name="build/libs/"`ls -l ./build/libs/|grep jar|grep -v grep|awk '{print $NF}'`
    #java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$port $jar_name 
elif [ $# == 1 ] && [ $1 == 'help' ]
then
    echo "please use this commands"
    echo "------------------------"
    echo "Start in Debug Mode: sh run.sh debug"
        echo "Start in Run Mode: sh run.sh" 
    echo "------------------------"
else
    gradle clean bootjar
    word_count=`ls -l ./build/libs/|grep jar|grep -v grep|wc -w`
    jar_name=`ls -l ./build/libs/|grep jar|grep -v grep|awk '{print $NF}'`  
    jar_path=build/libs/$jar_name
    echo $jar_name
    #java -jar $jar_path
fi

Hope this helps!!

TomasZ.'s user avatar

TomasZ.

4395 silver badges10 bronze badges

answered Mar 9, 2020 at 12:07

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

You can use below commands:

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


mvn -Dmaven.repo.local=c:repo any mvn command

answered May 17, 2022 at 12:15

Nirbhay Rana's user avatar

Nirbhay RanaNirbhay Rana

4,1612 gold badges18 silver badges4 bronze badges

Valid answer from this thread was the right answer for my special case.
Specify the ORM folder path for datanucleus certainly reduce the java path compile.

https://stackoverflow.com/a/1219427/1469481

Community's user avatar

answered Nov 2, 2013 at 14:45

smora's user avatar

smorasmora

6975 silver badges18 bronze badges

I got the error below when I run ‘ant deploy

Cannot run program "C:javajdk1.8.0_45binjava.exe": CreateProcess error=206, The filename or extension is too long

Fixed it by run ‘ant clean‘ before it.

answered Feb 4, 2016 at 0:46

maoyang's user avatar

maoyangmaoyang

1,0271 gold badge11 silver badges11 bronze badges

2

I got the same error in android studio. I was able to resolve it by running Build->Clean Project in the IDE.

mhatch's user avatar

mhatch

4,3256 gold badges36 silver badges60 bronze badges

answered Jun 13, 2017 at 9:28

Kiran's user avatar

KiranKiran

3782 silver badges15 bronze badges

0

I have this error in eclipse helios:

Exception occurred executing command line.
Cannot run program «C:Program Files (x86)Javajre6binjavaw.exe» (in directory «C:Usersmotiverhelios_workspaceTimeTracker»): CreateProcess error=206, The filename or extension is too long

I researched a bit but most of the issues were related to DataNucleus when working on Google App Engine. But I am not using anything remotely related to Google App Engine. I am doing a small project with Servlet 3.0 on JBOSS 6. I am using Hibernate 4.1.2 for ORM and RESTEasy to expose a web service. I created a util file that has a main() method that basically drops and re-creates the schema. I run the main() methos when I need a clean database for testing purposes. It worked fine on Tomcat 7 but it stopped working when I moved to JBoss 6.

Any hint or solution would be greatly appreciated.

BalusC's user avatar

BalusC

1.1m370 gold badges3585 silver badges3539 bronze badges

asked May 9, 2012 at 15:49

motiver's user avatar

4

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.

Favour Felix Chinemerem's user avatar

answered May 15, 2012 at 9:42

espinchi's user avatar

espinchiespinchi

9,0146 gold badges57 silver badges65 bronze badges

8

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"
}

answered Jun 8, 2018 at 13:53

Alejandro B.'s user avatar

Alejandro B.Alejandro B.

4,7272 gold badges38 silver badges60 bronze badges

3

**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

answered Feb 10, 2020 at 5:06

actan's user avatar

actanactan

5872 gold badges7 silver badges17 bronze badges

2

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.

answered Apr 25, 2014 at 17:47

Brad Mace's user avatar

Brad MaceBrad Mace

27k17 gold badges99 silver badges146 bronze badges

2

Answering my own question here so that the solution doesn’t get buried in comments. I exported the project as a runnable jar from within eclipse and did a command line «java -jar MyJar.jar» and it works perfectly fine

answered May 15, 2012 at 22:18

motiver's user avatar

motivermotiver

2,1824 gold badges18 silver badges20 bronze badges

This is not specifically for eclipse, but the way I got around this was by creating a symbolic link to my maven repository and pointing it to something like «C:R». Then I added the following to my settings.xml file:

<localRepository>C:R</localRepository>

The maven repository path was contributing to the length problems in my windows machine.

answered Jan 31, 2019 at 1:00

Shygar's user avatar

ShygarShygar

1,1438 silver badges10 bronze badges

Question is old, but still valid. I come across this situation often whenever a new member joins my team or a new code segment is added to existing code. Simple workaround we follow is to «Reduce the classpath» by moving up the directories.

As question mentioned, this is not specific to eclipse. I came across this issue in IntelliJ Idea 14 and 2018 as well.

After a long research, I found the solution is to set the

fork = false

in javc of ant build file.

<javac destdir="${build.dir}" fork="false" debug="on">
    <classpath .../>
    <src ... />
    <patternset ... />
</javac>

This is how my ant build javac looks now. To learn about more on fork, please refer ant documentation.

answered Jan 2, 2019 at 6:54

Don D's user avatar

Don DDon D

7261 gold badge9 silver badges19 bronze badges

0

In bug report Bug 327193 it is considered fixed, but it happen to me recently with Eclipse Kepler 4.3.2.

Please download patch for Eclipse Juno or newer:

https://bugs.eclipse.org/bugs/attachment.cgi?id=216593

  1. After download back up existing
    eclipse/plugins/org.eclipse.jdt.launching_3.*.jar
  2. Copy and paste classes in the patch to org.eclipse.jdt.launching JAR
    (replace existing files).
  3. Restart Eclipse.

answered May 22, 2014 at 19:52

Maciej Dzikowicki's user avatar

2

How many people sad above, there are a lot of plugins to gradle execute a by pass in this problem like:

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

or

plugins {
  id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}

But the better solution that I found was kill the JVM process and everything is done.

answered Aug 7, 2020 at 19:21

Ivan Rodrigues's user avatar

1

Try adding this in build.gradle (gradle version 4.10.x) file and check it out com.xxx.MainClass this is the class where your main method resides:

plugins {
  id "ua.eshepelyuk.ManifestClasspath" version "1.0.0"
}
apply plugin: 'application'
application {
    mainClassName = "com.xxx.MainClass"
}

The above change must resolve the issue, there is another way using script run.sh below could fix this issue, but it will be more of command-line fix, not in IntelliJ to launch gradle bootRun.

answered Mar 9, 2020 at 12:33

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

2

Try this:

java -jar -Dserver.port=8080 build/libs/APP_NAME_HERE.jar

answered Apr 6, 2017 at 17:44

user3272405's user avatar

To solve it:

If you are using Eclipse:

Move .m2 repository to

c:
Go to Eclipse > Windows/Preferences/Maven/User Settings -> Create your own setting.xml with its content:

<settings>
  <localRepository>c:/.m2/repository</localRepository>
</settings>

If you are using IntelliJ:
Go to IntelliJ > clicking the right mouse button on «pom.xml» > maven > create «settings.xml»

with its content:

<settings>
      xmlns="yourcontent"
      xmlns:xsi="yourcontent"
      xsi:schemaLocation="yourcontent.xsd">
  <localRepository>c:/.m2/repository</localRepository>
</settings>

answered May 31, 2019 at 10:00

R. Pereira's user avatar

R. PereiraR. Pereira

1751 gold badge2 silver badges9 bronze badges

In my case the error was showing because system java version was different from intellijj/eclipse java version. System and user had diff java versions. If you compile your code using one version and tried to run using a different version, it will error out.
User java version is 1.8

#The system java version is 1.7.131
$ java -version
java version "1.7.0_131"

Long story short, make sure your code is compiled and ran by the same java version.

answered Jun 20, 2019 at 1:34

z atef's user avatar

z atefz atef

6,7523 gold badges52 silver badges48 bronze badges

I am using legacy version of gradle plugins and this plugin solved the issue for me.

Usage (check source for more details):

Build script snippet for plugins DSL for Gradle 2.1 and later

plugins {
  id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}

Build script snippet for use in older Gradle versions or where dynamic
configuration is required

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.github.viswaramamoorthy:gradle-util-plugins:0.1.0-RELEASE"
  }
}

apply plugin: "com.github.ManifestClasspath"

answered May 6, 2020 at 13:08

Ilkin's user avatar

IlkinIlkin

3763 silver badges17 bronze badges

I have got same error, while invoking Maven.

The root cause for my problem was the classpath was very huge. Updating the classpath fixed the problem.

There are multiple ways to update the large classpath as mentioned in this: How to set a long Java classpath in Windows?

  1. Use wildcards
  2. Argument File
  3. Pathing jar

Since I am using Intellij, they provide the option to use Argument File that i used.

answered Jan 6, 2015 at 20:44

Sandeep Jindal's user avatar

Sandeep JindalSandeep Jindal

14.1k18 gold badges83 silver badges121 bronze badges

3

In a Windows machine, there is a limitation of the jar file name/path length in the command-line, due to which you see the below error message, I tried searching a lot, even I tried applying the above solution, some reason, it didn’t work, I found the working snippet for Gradle (gradle-4.10.2-all.zip)

Error:

CreateProcess error=206, The filename or extension is too long

Use this below gradle.build code snippet to fix the above problem in IntelliJ or STS, or eclipse anything.

Gradle Code Fix:

apply plugin: 'application'

task pathingJar(type: Jar) {
    dependsOn configurations.runtime
    appendix = 'pathing'

    doFirst {
        manifest {
            attributes "Class-Path": configurations.runtimeClasspath.files.collect { it.getName() }.join(' ')
        }
    }
}

task copyToLib(type: Copy) {
    into "$buildDir/libs"
    from configurations.runtime
}

bootRun {
    systemProperties = System.properties
    //This below line is for if you have different profiles prod, dev etc...
    //systemProperty 'spring.profiles.active', 'dev'
    jvmArgs('-Djava.util.logging.config.file=none')
    mainClassName = "com.xxxx.Main"
    dependsOn pathingJar
    dependsOn copyToLib
    doFirst {
        classpath = files("$buildDir/classes/java/main", "$buildDir/resources/main", pathingJar.archivePath)
    }
}

answered Jul 8, 2020 at 17:26

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

If you are using VSCode:

  1. create launch.json file insde .vscode/

  2. add

    {"configurations": [{ "type": "java","shortenCommandLine ": "auto",}]}
    

If you are using intellij :

  1. open .idea/workspace.xml

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

Suraj Rao's user avatar

Suraj Rao

29.3k11 gold badges96 silver badges103 bronze badges

answered Jan 12, 2022 at 14:31

mans.luv.2.code's user avatar

it happens due to DataNucleus sometimes overwrite the Arguments with many paths.

You have to overwrite them with this:

-enhancerName ASM -api JDO -pu MediaToGo

Hope help you!

answered May 2, 2013 at 14:55

Rodrigohsb's user avatar

I got the same error. Tried solutions like cleaning, rebuild, invalidateCache, retart etc but nothing works.

I just have created a new folder with short name and copied all the files(app folder, gradle files etc) in new folder. Opened application in android studio and its working fine.

answered Oct 31, 2018 at 10:39

Tara's user avatar

TaraTara

2,5701 gold badge20 silver badges30 bronze badges

For me it was wrong JDK path. Please make sure you have right path to the JDK file

File -> Project Structure

enter image description here

answered Mar 17, 2021 at 5:46

Muhammad Hamza Shahid's user avatar

If you are using Android Studio try Invalidate Caches/ Restart.. option present in File menu

answered Jun 5, 2021 at 10:26

SagaRock101's user avatar

m4n0's user avatar

m4n0

28.6k26 gold badges74 silver badges89 bronze badges

answered Sep 15, 2021 at 6:15

Naeem Ghumman's user avatar

To fix this below error, I did enough research, not got any great solution, I prepared this script and it is working fine, thought to share to the public and make use of it and save there time.

CreateProcess error=206, The filename or extension is too long

If you are using the Gradle build tool, and the executable file is placed in build/libs directory of your application.
run.sh -> create this file in the root directory of your project, and copy below script in it, then go to git bash and type run.sh then enter. Hope this helps!

#!/bin/bash
dir_name=`pwd`
if [ $# == 1 ] && [ $1 == "debug" ]
then
    port=$RANDOM
    quit=0
    echo "Finding free port for debugging"
    while [ "$quit" -ne 1 ]; do
        netstat -anp | grep $port >> /dev/null
        if [ $? -gt 0 ]; then
            quit=1
        else
            port=`expr $port + 1`
        fi
    done
    echo "Starting in Debug Mode on "$port
    gradle clean bootjar
    jar_name="build/libs/"`ls -l ./build/libs/|grep jar|grep -v grep|awk '{print $NF}'`
    #java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$port $jar_name 
elif [ $# == 1 ] && [ $1 == 'help' ]
then
    echo "please use this commands"
    echo "------------------------"
    echo "Start in Debug Mode: sh run.sh debug"
        echo "Start in Run Mode: sh run.sh" 
    echo "------------------------"
else
    gradle clean bootjar
    word_count=`ls -l ./build/libs/|grep jar|grep -v grep|wc -w`
    jar_name=`ls -l ./build/libs/|grep jar|grep -v grep|awk '{print $NF}'`  
    jar_path=build/libs/$jar_name
    echo $jar_name
    #java -jar $jar_path
fi

Hope this helps!!

TomasZ.'s user avatar

TomasZ.

4395 silver badges10 bronze badges

answered Mar 9, 2020 at 12:07

ravibeli's user avatar

ravibeliravibeli

4848 silver badges28 bronze badges

You can use below commands:

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


mvn -Dmaven.repo.local=c:repo any mvn command

answered May 17, 2022 at 12:15

Nirbhay Rana's user avatar

Nirbhay RanaNirbhay Rana

4,1612 gold badges18 silver badges4 bronze badges

Valid answer from this thread was the right answer for my special case.
Specify the ORM folder path for datanucleus certainly reduce the java path compile.

https://stackoverflow.com/a/1219427/1469481

Community's user avatar

answered Nov 2, 2013 at 14:45

smora's user avatar

smorasmora

6975 silver badges18 bronze badges

I got the error below when I run ‘ant deploy

Cannot run program "C:javajdk1.8.0_45binjava.exe": CreateProcess error=206, The filename or extension is too long

Fixed it by run ‘ant clean‘ before it.

answered Feb 4, 2016 at 0:46

maoyang's user avatar

maoyangmaoyang

1,0271 gold badge11 silver badges11 bronze badges

2

I got the same error in android studio. I was able to resolve it by running Build->Clean Project in the IDE.

mhatch's user avatar

mhatch

4,3256 gold badges36 silver badges60 bronze badges

answered Jun 13, 2017 at 9:28

Kiran's user avatar

KiranKiran

3782 silver badges15 bronze badges

0

Содержание

  1. CreateProcess error=206, The filename or extension is too long #110
  2. Comments
  3. Ошибка CreateProcess = 206, имя файла или расширение слишком длинное при запуске метода main ()
  4. 17 ответов
  5. CreateProcess error=206, The filename or extension is too long — Maven and Windows #8878
  6. Comments
  7. Ошибка CreateProcess = 206, имя файла или расширение слишком длинное при запуске метода main ()
  8. 32 ответа

CreateProcess error=206, The filename or extension is too long #110

/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:28 Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program «F:job2017vscodedev_tools20170918Javajdk1.8.0_91jrebinjava»: CreateProcess error=206, The filename or extension is too long.

The text was updated successfully, but these errors were encountered:

@testforstephen please follow up with this.

This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

What information is needed? I am having the issue and can provide additional information, but there’s no clear request in this ticket’s history.

Could you tell us your classpath length? we want to find the length limitation for CreateProcess, then find a project to reproduce the problem.

Windows Create Process has 32K limitation on the command line. [Source]
Need find some way to pass the long classpath to Java program.

Sorry, I’m new to Java — how do I determine the classpath value/length?

@jamestharpe thanks for response. we have figured out the maximum command line length. It’s 32K(32768) characters. Will provide a fix for the long classpath case.

@testforstephen It can easily be reproduced adding to a simple Spring Boot application with the dependency as below:

I can share the entire gradle project if you want.

@EnriqueEll Thanks for the feedback, appreciate a lot if you can share the entire gradle project to help us to verify the bug.

You have any solution, because I have the same problem.

I am getting this error in windows 10.

[Error — 7:09:48 PM] 21-Jan-2019, 7:09:47 PM [error response][launch]: Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program «C:Program FilesJavajdk-10.0.2binjava» (in directory «c:UsersSumanthDocumentsturbo-workspacedev-for-uat-release18-elb»): CreateProcess error=206, The filename or extension is too long
Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program «C:Program FilesJavajdk-10.0.2binjava» (in directory «c:UsersSumanthDocumentsturbo-workspacedev-for-uat-release18-elb»): CreateProcess error=206, The filename or extension is too long
com.microsoft.java.debug.core.DebugException: Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program «C:Program FilesJavajdk-10.0.2binjava» (in directory «c:UsersSumanthDocumentsturbo-workspacedev-for-uat-release18-elb»): CreateProcess error=206, The filename or extension is too long
at com.microsoft.java.debug.core.adapter.handler.LaunchWithoutDebuggingDelegate.launchInternally(LaunchWithoutDebuggingDelegate.java:94)
at com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler.launch(LaunchRequestHandler.java:142)
at com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler.handleLaunchCommand(LaunchRequestHandler.java:90)
at com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler.handle(LaunchRequestHandler.java:57)
at com.microsoft.java.debug.core.adapter.DebugAdapter.lambda$dispatchRequest$0(DebugAdapter.java:85)
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
at com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:84)
at com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:118)
at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.lambda$new$0(AbstractProtocolServer.java:78)
at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:60)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)

[Error — 7:09:48 PM] 21-Jan-2019, 7:09:48 PM [error response][launch]: Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program «C:Program FilesJavajdk-10.0.2binjava» (in directory «c:UsersSumanthDocumentsturbo-workspacedev-for-uat-release18-elb»): CreateProcess error=206, The filename or extension is too long
Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program «C:Program FilesJavajdk-10.0.2binjava» (in directory «c:UsersSumanthDocumentsturbo-workspacedev-for-uat-release18-elb»): CreateProcess error=206, The filename or extension is too long
com.microsoft.java.debug.core.DebugException: Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program «C:Program FilesJavajdk-10.0.2binjava» (in directory «c:UsersSumanthDocumentsturbo-workspacedev-for-uat-release18-elb»): CreateProcess error=206, The filename or extension is too long
at com.microsoft.java.debug.core.adapter.handler.LaunchWithoutDebuggingDelegate.launchInternally(LaunchWithoutDebuggingDelegate.java:94)
at com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler.launch(LaunchRequestHandler.java:142)
at com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler.handleLaunchCommand(LaunchRequestHandler.java:90)
at com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler.handle(LaunchRequestHandler.java:57)
at com.microsoft.java.debug.core.adapter.DebugAdapter.lambda$dispatchRequest$0(DebugAdapter.java:85)
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
at com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:84)
at com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:118)
at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.lambda$new$0(AbstractProtocolServer.java:78)
at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:60)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)

Gentlemen, please could you do something about this problem as it practically renders VSCode unable to debug any non-trivial Spring Boot project on Windows!

The problem is, as @testforstephen pointed out, with Windows command line length limit which is 32768 characters.

It is also rather simple to reproduce as @EnriqueEll has shown: Once you have some very basic Gradle project for Spring Boot application (created with Spring Initializr, https://start.spring.io/) e.g.:

It starts and debugs correctly until you un-comment two commented lines in dependencies section when it displays said «206» error. Also if you use command line sequence gradle clean build and then gradle bootRun it will fail to start.

Источник

Ошибка CreateProcess = 206, имя файла или расширение слишком длинное при запуске метода main ()

У меня есть эта ошибка в eclipse helios:

Исключение произошло при выполнении командной строки. Не удается запустить программу «C:Program Files (x86)Javajre6binjavaw.exe» (в каталоге «C:Usersmotiverhelios_workspaceTimeTracker» ): Ошибка CreateProcess = 206, имя файла или расширение слишком долго

Я немного изучил, но большинство проблем были связаны с DataNucleus при работе с Google App Engine. Но я не использую ничего удаленного с Google App Engine. Я делаю небольшой проект с Servlet 3.0 на JBOSS 6. Я использую Hibernate 4.1.2 для ORM и RESTEasy, чтобы открыть веб-службу. Я создал файл утилиты, который имеет метод main(), который в основном отбрасывает и воссоздает схему. Я запускаю main() methos, когда мне нужна чистая база данных для тестирования. Он отлично работал на Tomcat 7, но он перестал работать, когда перешел на JBoss 6.

Было бы полезно получить любую подсказку или решение.

17 ответов

В этой проблеме нет простого (как в случае нескольких кликов или простой команды).

Цитата из некоторых ответов в этот отчет об ошибках в Eclipse.org, это обходные пути. Выберите тот, который вам наименее болезненным:

  • Уменьшить путь к классам
  • Используйте каталоги вместо файлов jar.
  • Используйте упакованные файлы jar, которые содержат все другие банки, используйте переменную classpath внутри файла манифеста, чтобы указать на другие банки
  • Используйте специальный загрузчик классов, который читает путь к классам из файла конфигурации
  • Попробуйте использовать один из прикрепленных исправлений в документе отчета об ошибке
  • Используйте собственную оболочку, например. ant
  • Перейдите в IntelliJ (Update: как указывает @nitind, это не вариант)

Обновление. После июля 2014 года есть лучший способ (спасибо @Brad-Mace ответ ниже:

Если вы создали свой собственный файл сборки вместо Project -> Generate Javadocs , вы можете добавить useexternalfile=»yes» в задачу Javadoc, предназначенную специально для решения этой проблемы.

Источник

CreateProcess error=206, The filename or extension is too long — Maven and Windows #8878

Overview of the issue

The goal spring-boot:run fails due to classpath being too large in a jhUAA project with too many dependencies selected on Windows (using Maven).

Seems to be the same issue as #4323 except for Maven. For Gradle it was fixed with #4324.

Motivation for or Use Case

Generated microservice jhUAA application cannot be run on Windows.

Reproduce the error

Generate a microservice UAA application on Windows with preferences of following .yo-rc.json file

Related issues

Seems like #4323 is the same issue just for gradle

Suggest a Fix

Perhaps it can be fixed in the same way as #4323 was fixed (see #4324)

JHipster Version(s)
JHipster configuration

jhipster info
INFO! Using JHipster version installed locally in current project’s node_modules
INFO! Executing jhipster:info
INFO! Options: from-cli: true
Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
JHipster configuration, a .yo-rc.json file generated in the root folder
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
Environment and Tools

java version «1.8.0_171»
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

git version 2.10.2.windows.1

INFO! Congratulations, JHipster execution is complete!

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Chrome and Windows 10

  • Checking this box is mandatory (this is just to show you read everything)

The text was updated successfully, but these errors were encountered:

Источник

Ошибка CreateProcess = 206, имя файла или расширение слишком длинное при запуске метода main ()

У меня такая ошибка в eclipse helios:

Исключение при выполнении командной строки. Не удается запустить программу «C: Program Files (x86) Java jre6 bin javaw.exe» (в каталоге «C: Users motiver helios_workspace TimeTracker»): ошибка CreateProcess = 206, имя файла или расширение: слишком долго

Я немного исследовал, но большинство проблем были связаны с DataNucleus при работе над Google App Engine. Но я не использую ничего отдаленно связанного с Google App Engine. Я делаю небольшой проект с Servlet 3.0 на JBOSS 6. Я использую Hibernate 4.1.2 для ORM и RESTEasy, чтобы открыть веб-службу. Я создал файл util, в котором есть метод main (), который в основном удаляет и воссоздает схему. Я запускаю методы main (), когда мне нужна чистая база данных для целей тестирования. Он отлично работал на Tomcat 7, но перестал работать, когда я перешел на JBoss 6.

Приветствуются любые подсказки или решения.

32 ответа

Простого (в пару кликов или простой команды) решения этой проблемы не существует.

Цитируя некоторые ответы в этом отчете об ошибке в Eclipse.org, это обходные пути. Выберите тот, который наименее болезненен для вас:

  • Уменьшите путь к классам
  • Используйте каталоги вместо файлов jar
  • Используйте упакованные файлы jar, которые содержат все другие jar-файлы, используйте переменную classpath внутри файла манифеста, чтобы указать на другие jar-файлы
  • Используйте специальный загрузчик классов, который считывает путь к классам из файла конфигурации.
  • Попробуйте использовать один из прикрепленных патчей в документе с отчетом об ошибке
  • Используйте собственную оболочку, например. муравей

Обновление : после июля 2014 года есть способ лучше (благодаря ответу @ Brad-Mace ниже :

Если вы создали свой собственный файл сборки вместо использования Project -> Generate Javadocs , вы можете добавить useexternalfile=»yes» в задачу Javadoc, которая разработана специально для решения этой проблемы.

Источник

Gentlemen, please could you do something about this problem as it practically renders VSCode unable to debug any non-trivial Spring Boot project on Windows!

The problem is, as @testforstephen pointed out, with Windows command line length limit which is 32768 characters.

It is also rather simple to reproduce as @EnriqueEll has shown: Once you have some very basic Gradle project for Spring Boot application (created with Spring Initializr, https://start.spring.io/) e.g.:

buildscript {
	ext {
		springBootVersion = '2.0.6.RELEASE'
	}
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
	}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.necne'
version = '0.0.1'
sourceCompatibility = 1.8

repositories {
	mavenCentral()
}

dependencies {
	implementation('org.springframework.boot:spring-boot-starter-data-jpa')
	implementation('org.springframework.boot:spring-boot-starter-web')
	runtimeOnly('org.springframework.boot:spring-boot-devtools')
	runtimeOnly('com.h2database:h2')
	testImplementation('org.springframework.boot:spring-boot-starter-test')

	implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
	implementation('org.mongodb.spark:mongo-spark-connector_2.11:2.3.1')

	// compile('org.apache.spark:spark-core_2.11:2.3.2')
	// compile('org.apache.spark:spark-sql_2.11:2.3.2')

	implementation("io.springfox:springfox-swagger2:2.0.2")
	implementation("io.springfox:springfox-swagger-ui:2.0.2")
}

It starts and debugs correctly until you un-comment two commented lines in dependencies section when it displays said «206» error. Also if you use command line sequence gradle clean build and then gradle bootRun it will fail to start.

This problem has long been known for long time (e.g. gradle/gradle#1989, https://virgo47.wordpress.com/2018/09/14/classpath-too-long-with-spring-boot-and-gradle/) and there are some ways to deal with, most notably, there is a way to make Gradle build a .jar with paths for all of the classes referenced. There is a plugin for Gradle (ManifestClasspath) which has a bug rendering it unusable for paths with spaces and there is a number of solutions involving modification of build.gradle so that it creates appropriate .jar.

All of the tools had to deal with this in some way, e.g. InteliJ IDEA has appropriate setting in project settings:

shorten-command-line

So generally if I understand things correctly there is a need to modify command line that invokes debug session to include classpath.jar and exclude all paths passed explicitly. This should be possible to do using command in launch.json but my attempts to do so were unsuccessful — probably there is something underneath that passes the paths even if args in launch.json try to pass the name of the classpath.jar.

17 ответов

В этой проблеме нет простого (как в случае нескольких кликов или простой команды).

Цитата из некоторых ответов в этот отчет об ошибках в Eclipse.org, это обходные пути. Выберите тот, который вам наименее болезненным:

  • Уменьшить путь к классам
  • Используйте каталоги вместо файлов jar.
  • Используйте упакованные файлы jar, которые содержат все другие банки, используйте переменную classpath внутри файла манифеста, чтобы указать на другие банки
  • Используйте специальный загрузчик классов, который читает путь к классам из файла конфигурации
  • Попробуйте использовать один из прикрепленных исправлений в документе отчета об ошибке
  • Используйте собственную оболочку, например. ant
  • Перейдите в IntelliJ (Update: как указывает @nitind, это не вариант)

Обновление. После июля 2014 года есть лучший способ (спасибо @Brad-Mace ответ ниже:

Если вы создали свой собственный файл сборки вместо Project -> Generate Javadocs, вы можете добавить useexternalfile="yes" в задачу Javadoc, предназначенную специально для решения этой проблемы.

espinchi
15 май 2012, в 10:03

Поделиться

Если вы создаете свой собственный файл сборки, а не используете Project -> Generate Javadocs, вы можете добавить useexternalfile="yes" в задачу javadoc, которая разработана специально для решения этой проблемы.

Brad Mace
25 апр. 2014, в 18:01

Поделиться

Я столкнулся с этой проблемой сегодня, и я смог решить ее с помощью этого плагина Gradle

Это GitHub URL это

Если вы, как и я, понятия не имеете, что такое Gradle, но вам нужно запустить бэкэнд для выполнения вашей работы с внешним интерфейсом, вам нужно найти файл build.gradle, который вызывается для запуска вашего сервера BE, и добавить его в вершина:

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

Alejandro B.
08 июнь 2018, в 15:27

Поделиться

Отвечая на мой собственный вопрос, чтобы решение не зарывалось в комментариях. Я экспортировал проект в качестве исполняемого банку из eclipse и выполнил командную строку «java -jar MyJar.jar», и он отлично работает

motiver
15 май 2012, в 22:33

Поделиться

У меня такая же ошибка, при вызове Maven.

Основной причиной моей проблемы был classpath был очень большой. Обновление пути к классам устранено.

Sandeep Jindal
06 янв. 2015, в 21:31

Поделиться

В отчете об ошибке Ошибка 327193 считается фиксированным, но это происходит со мной недавно с Eclipse Kepler 4.3.2.

Загрузите патч для Eclipse Juno или новее:

https://bugs.eclipse.org/bugs/attachment.cgi?id=216593

  • После загрузки резервной копии существующих
    Затмение/плагины/org.eclipse.jdt.launching_3. *. баночка
  • Скопировать и вставить классы в патч в org.eclipse.jdt.launching JAR
    (заменить существующие файлы).
  • Перезапустить Eclipse.

Maciej Dzikowicki
22 май 2014, в 21:23

Поделиться

Попробуйте следующее:

java -jar -Dserver.port = 8080 build/libs/APP_NAME_HERE.jar

user3272405
06 апр. 2017, в 18:49

Поделиться

Это не специально для затмения, но я обошел это путем создания символической ссылки на мой репозиторий maven и указания на что-то вроде «C:R». Затем я добавил следующее в мой файл settings.xml:

<localRepository>C:R</localRepository>

Путь к репозиторию maven способствовал проблемам с длиной в моей машине с Windows.

Shygar
31 янв. 2019, в 02:52

Поделиться

Вопрос старый, но все еще актуален. Я часто сталкиваюсь с такой ситуацией, когда к моей команде присоединяется новый участник или в существующий код добавляется новый сегмент кода. Простой обходной путь, которому мы следуем, — это «Уменьшить путь к классам», перемещаясь вверх по каталогам.

Как уже упоминалось, это не относится к затмению. Я сталкивался с этой проблемой также в IntelliJ Idea 14 и 2018.

После долгих исследований я нашел решение установить

fork = false

в javc файла сборки муравья.

<javac destdir="${build.dir}" fork="false" debug="on">
    <classpath .../>
    <src ... />
    <patternset ... />
</javac>

Вот так теперь выглядит мой сборщик муравьев javac. Чтобы узнать больше о форке, обратитесь к документации по муравьям.

Don D
02 янв. 2019, в 06:57

Поделиться

Я получил ту же ошибку. Пробные решения, такие как очистка, восстановление, invalidateCache, retart и т.д., Но ничего не работает.

Я только что создал новую папку с коротким именем и скопировал все файлы (папку приложения, файлы Gradle и т.д.) В новую папку. Открыл приложение в андроид студии и работает нормально.

Tara
31 окт. 2018, в 11:06

Поделиться

У меня была такая же проблема, но вместо этого я использовал netbeans.
Я нашел решение, поэтому я делюсь здесь, потому что я нигде не нашел этого, поэтому, если у вас есть эта проблема на NetBeans, попробуйте это:
(имена могут быть отключены, так как мои NetBeans на португальском языке) Щелкните правой кнопкой мыши проект> свойства> сборка> компиляция> Снимите флажок запускать компиляцию на внешней виртуальной машине.

Régis B.
01 авг. 2018, в 19:26

Поделиться

Это из-за вашего длинного имени каталога проекта, которое дает вам очень длинный CLASSPATH целом. Либо вам нужно уменьшить количество jar файлов, добавленных в CLASSPATH (убедитесь, что вы удалили только ненужные jar файлы), либо лучше всего уменьшить каталог проекта и снова импортировать проект. Это уменьшит CLASSPATH. Это сработало для меня.

deepesh kumar
22 май 2018, в 06:34

Поделиться

Я получил ту же ошибку в студии Android. Я смог разрешить его, запустив Сборка Очистить проект в среде IDE.

Kiran
13 июнь 2017, в 10:47

Поделиться

Я получил ошибку ниже, когда я запускаю ant deploy

Cannot run program "C:javajdk1.8.0_45binjava.exe": CreateProcess error=206, The filename or extension is too long

Исправлено его, выполнив ‘ ant clean‘.

maoyang
04 фев. 2016, в 00:59

Поделиться

это происходит из-за того, что DataNucleus иногда перезаписывает Аргументы со многими путями.

Вам необходимо перезаписать их следующим образом:

-enhancerName ASM -api JDO -pu MediaToGo

Надеюсь помочь вам!

Rodrigohsb
02 май 2013, в 15:43

Поделиться

Ещё вопросы

  • 1В чем разница между версиями файлов классов Java
  • 1Android: HttpClient POST: NullPointerException
  • 1JavaScript-код для отображения предупреждающего сообщения после 15 нажатий клавиш
  • 0Как создать новый экземпляр в Angularjs? Метод сохранения CRUD не работает
  • 0Создание объектов в куче через функцию класса
  • 1Android: оптимизировать только для устройств с высоким разрешением, но при этом поддерживать (маленькие и) экраны со средним разрешением
  • 0Обновить индекс элемента при выборе опции, используя jQuery
  • 0Показать строки из других таблиц, если они существуют (SQL)
  • 0Переопределить изображения, получая высоту + ширину из CSS, вместо этого атрибут html
  • 1Как правильно заменить существующую JPanel в JFrame на другую?
  • 0Flask возвращает ошибку: потеря соединения с сервером MySQL, системная ошибка: 60
  • 1VueJs отображает все элементы при одном изменении
  • 0Компиляция с использованием nvcc дает «Нет такого файла или каталога»
  • 0Как получить объект данных из тега в IE8
  • 1Скрытый марковский модельный питон
  • 0Реализация барьера с использованием мьютекса и семафора
  • 0ассоциативный массив установлен неправильно
  • 1преобразовать массив numpy из объекта dtype в float
  • 0Составление списка элементов без абсолютного позиционирования
  • 0Процент изображения не ограничен
  • 1Ошибка SVC для DLL я не включил
  • 0Конвертировать HTML в XML, используя Java
  • 1Использование клиентских веб-сервисов сгенерированных JAXB классов в качестве объектов JPA
  • 0Как вызвать функцию в контроллере AngularJS с помощью метода $ scope?
  • 1Нужно ли устанавливать Anaconda, если у меня уже есть PyCharm? Если так, будут ли они хорошо работать вместе?
  • 0Массив объекта, как сделать выбор параметров
  • 0Как функции l-значения работают в c ++?
  • 0CSS для печатных СМИ, чтобы показать бегущую страницу на определенных страницах
  • 0Python или Html живой поток с камеры?
  • 0Событие удаляется из очереди при публикации в окне в Qt
  • 0Соединение вашего приложения с базой данных
  • 0Удаление выделений родительского конструктора из дочернего деструктора
  • 0не получая динамически добавленное поле ввода
  • 0Возвращение итератора из функции вызывает у меня странную ошибку
  • 1odoo, как обновить значение одного поля, обновив значение другого, оба поля находятся в разных классах
  • 0невозможно выровнять элемент в HTML-форме
  • 0ADO не получает данные из базы данных, используя фильтр, определенный переменной
  • 0Как я могу получить идентификатор данных в добавленной кнопке?
  • 0Вставка значений в базу данных с использованием PDO в Jquery AJAX PHP
  • 1Как создать экземпляр класса по имени строки
  • 1просмотрите папку и получите пользовательский ввод для создания нового файла
  • 0Не могу разобрать этот XML правильно в php
  • 0Какая разница между argv [1] +1 и argv [2]
  • 1WPF, MVVM, EventBehaviourFactory в ListView, привязка события к команде
  • 0Проблемы с вызовом хранимой процедуры mySQL через функцию Node.JS
  • 1не удалось загрузить общую библиотеку JNI «C: Windows system32 .. jre bin client jvm.dll » ECLIPSE
  • 0MoneyWorks: программно обновить запись
  • 0Цикл по полям с помощью jQuery Validation
  • 1JOOQ сгенерировал записи, установленные для реализации интерфейса Record4, даже если не установлен
  • 1Инициализируйте значение var в null для строго типизированного

Понравилась статья? Поделить с друзьями:
  • Ide error occurred перевод
  • Ict a7 ошибки купюроприемник
  • I2cp error listening to port 7654 is another i2p instance running
  • Icsee error content ошибка сети
  • I2c rw error status 0x4198fe00