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
1.1m370 gold badges3585 silver badges3539 bronze badges
asked May 9, 2012 at 15:49
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.
answered May 15, 2012 at 9:42
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.Alejandro B.
4,7272 gold badges38 silver badges60 bronze badges
3
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
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 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
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
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 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
- After download back up existing
eclipse/plugins/org.eclipse.jdt.launching_3.*.jar - Copy and paste classes in the patch to org.eclipse.jdt.launching JAR
(replace existing files). - Restart Eclipse.
answered May 22, 2014 at 19:52
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
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
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
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. 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.
#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 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 requiredbuildscript { 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
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?
- Use wildcards
- Argument File
- 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 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
ravibeliravibeli
4848 silver badges28 bronze badges
If you are using VSCode:
-
create launch.json file insde .vscode/
-
add
{"configurations": [{ "type": "java","shortenCommandLine ": "auto",}]}
If you are using intellij :
-
open .idea/workspace.xml
-
inside
<component name="PropertiesComponent">
add<property name="dynamic.classpath" value="true"/>
Suraj Rao
29.3k11 gold badges96 silver badges103 bronze badges
answered Jan 12, 2022 at 14:31
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
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
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
answered Mar 17, 2021 at 5:46
If you are using Android Studio try Invalidate Caches/ Restart.. option present in File menu
answered Jun 5, 2021 at 10:26
m4n0
28.6k26 gold badges74 silver badges89 bronze badges
answered Sep 15, 2021 at 6:15
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.
4395 silver badges10 bronze badges
answered Mar 9, 2020 at 12:07
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 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
answered Nov 2, 2013 at 14:45
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
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
4,3256 gold badges36 silver badges60 bronze badges
answered Jun 13, 2017 at 9:28
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
1.1m370 gold badges3585 silver badges3539 bronze badges
asked May 9, 2012 at 15:49
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.
answered May 15, 2012 at 9:42
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.Alejandro B.
4,7272 gold badges38 silver badges60 bronze badges
3
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
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 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
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
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 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
- After download back up existing
eclipse/plugins/org.eclipse.jdt.launching_3.*.jar - Copy and paste classes in the patch to org.eclipse.jdt.launching JAR
(replace existing files). - Restart Eclipse.
answered May 22, 2014 at 19:52
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
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
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
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. 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.
#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 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 requiredbuildscript { 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
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?
- Use wildcards
- Argument File
- 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 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
ravibeliravibeli
4848 silver badges28 bronze badges
If you are using VSCode:
-
create launch.json file insde .vscode/
-
add
{"configurations": [{ "type": "java","shortenCommandLine ": "auto",}]}
If you are using intellij :
-
open .idea/workspace.xml
-
inside
<component name="PropertiesComponent">
add<property name="dynamic.classpath" value="true"/>
Suraj Rao
29.3k11 gold badges96 silver badges103 bronze badges
answered Jan 12, 2022 at 14:31
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
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
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
answered Mar 17, 2021 at 5:46
If you are using Android Studio try Invalidate Caches/ Restart.. option present in File menu
answered Jun 5, 2021 at 10:26
m4n0
28.6k26 gold badges74 silver badges89 bronze badges
answered Sep 15, 2021 at 6:15
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.
4395 silver badges10 bronze badges
answered Mar 9, 2020 at 12:07
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 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
answered Nov 2, 2013 at 14:45
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
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
4,3256 gold badges36 silver badges60 bronze badges
answered Jun 13, 2017 at 9:28
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
1.1m370 gold badges3585 silver badges3539 bronze badges
asked May 9, 2012 at 15:49
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.
answered May 15, 2012 at 9:42
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.Alejandro B.
4,7272 gold badges38 silver badges60 bronze badges
3
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
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 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
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
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 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
- After download back up existing
eclipse/plugins/org.eclipse.jdt.launching_3.*.jar - Copy and paste classes in the patch to org.eclipse.jdt.launching JAR
(replace existing files). - Restart Eclipse.
answered May 22, 2014 at 19:52
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
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
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
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. 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.
#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 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 requiredbuildscript { 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
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?
- Use wildcards
- Argument File
- 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 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
ravibeliravibeli
4848 silver badges28 bronze badges
If you are using VSCode:
-
create launch.json file insde .vscode/
-
add
{"configurations": [{ "type": "java","shortenCommandLine ": "auto",}]}
If you are using intellij :
-
open .idea/workspace.xml
-
inside
<component name="PropertiesComponent">
add<property name="dynamic.classpath" value="true"/>
Suraj Rao
29.3k11 gold badges96 silver badges103 bronze badges
answered Jan 12, 2022 at 14:31
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
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
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
answered Mar 17, 2021 at 5:46
If you are using Android Studio try Invalidate Caches/ Restart.. option present in File menu
answered Jun 5, 2021 at 10:26
m4n0
28.6k26 gold badges74 silver badges89 bronze badges
answered Sep 15, 2021 at 6:15
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.
4395 silver badges10 bronze badges
answered Mar 9, 2020 at 12:07
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 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
answered Nov 2, 2013 at 14:45
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
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
4,3256 gold badges36 silver badges60 bronze badges
answered Jun 13, 2017 at 9:28
KiranKiran
3782 silver badges15 bronze badges
0
Содержание
- CreateProcess error=206, The filename or extension is too long #110
- Comments
- CreateProcess error=206, The filename or extension is too long — Maven and Windows #8878
- Comments
- CreateProcess error=206, имя файла или расширение слишком длинное при запуске метода main
- 14 ответов:
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 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 error=206, имя файла или расширение слишком длинное при запуске метода main
У меня есть эта ошибка в eclipse helios:
исключение произошло при выполнении командной строки.
Не удается запустить программу «C:Program файлы (x86)Javajre6binjavaw.exe » (в каталоге «C:Usersmotiverhelios_workspaceTimeTracker»): CreateProcess error=206, имя файла или расширение слишком длинное
Я исследовал немного, но большинство вопросов были связаны с DataNucleus при работе на Google App Engine. Но я не использую ничего отдаленно связанного с Google Приложение Двигателя. Я делаю небольшой проект с сервлетом 3.0 на JBOSS 6. Я использую Hibernate 4.1.2 для ORM и RESTEasy для предоставления веб-службы. Я создал файл util, который имеет метод main (), который в основном удаляет и повторно создает схему. Я запускаю main () methos, когда мне нужна чистая база данных для целей тестирования. Он отлично работал на Tomcat 7, но он перестал работать, когда я переехал в JBoss 6.
любой намек или решение были бы весьма признательны.
14 ответов:
нет простого (как в пару кликов или простой команды) решения этой проблемы.
цитирование из некоторых ответов в этот отчет об ошибке в Eclipse.org, это обходные пути. Выберите тот, который является наименее болезненным для вас:
- уменьшить путь к классу
- использовать каталоги вместо файлов jar
- используйте упакованные файлы jar, которые содержат все другие банки, используйте переменную classpath внутри файла манифеста, чтобы укажите на другие банки
- используйте специальный загрузчик классов, который считывает путь к классу из файла конфигурации
- попробуйте использовать один из прикрепленных патчей в документе отчета об ошибке
- используйте собственную обертку, например, ant
- перейти к IntelliJ (обновление: как указывает @nitind, это не вариант)
обновление: после июля 2014 года, есть лучший способ (благодаря ответ@Brad-Mace ниже:
Если вы создали свой собственный файл сборки вместо использования Project -> Generate Javadocs , то вы можете добавить useexternalfile=»yes» к задаче Javadoc, которая разработана специально для решения этой проблемы.
Если вы создаете свой собственный файл build, а не с помощью Project -> Generate Javadocs вы можете добавить useexternalfile=»yes» до javadoc задача, которая разработана специально для решения этой проблемы.
попробуйте обновить версию Eclipse, проблема была закрыта недавно (2013-03-12). Проверьте отчет об ошибкеhttps://bugs.eclipse.org/bugs/show_bug.cgi?id=327193
отвечая на мой собственный вопрос здесь, чтобы решение не было похоронено в комментариях. Я экспортировал проект как запускаемый jar из eclipse и сделал командную строку «java-jar MyJar.jar » и он отлично работает
по сообщению 327193 ошибка это считается фиксированным, но это случилось со мной недавно с Eclipse Kepler 4.3.2.
пожалуйста, скачайте патч для Eclipse Juno или новее:
- после загрузки резервное копирование существующих eclipse / plugins / org.затмение.JDT, предназначенным.launching_3.*.банку
- копирование и вставка классов в патч в организацию.затмение.JDT, предназначенным.запуск банку (заменять существующий файл.)
- Перезапустить Eclipse.
Я получил ту же ошибку, при вызове Maven.
основной причиной моей проблемы была classpath был очень огромный. Обновление пути к классам устранило проблему.
Я сегодня столкнулся с этой проблемой и смог решить ее с помощью этот плагин Gradle
Если вы, как и я, понятия не имеете, что такое Gradle, но вам нужно запустить бэкэнд, чтобы выполнить свою переднюю работу, вам нужно найти построить.gradle файл, который вызывается для запуска вашего сервера BE и добавьте это в начало:
это происходит из-за DataNucleus иногда перезаписывают аргументы со многими путями.
вы должны перезаписать их следующим образом:
— enhancerName ASM-api JDO-pu MediaToGo
правильный ответ из этой темы был правильным ответом для моего особого случая. Укажите путь к папке ORM для datanucleus, конечно, уменьшите компиляцию пути java.
Я получил сообщение об ошибке ниже, когда я запускаю’развернуть АНТ‘
исправлено с помощью run’очистить муравей‘, прежде чем он.
Я получил ту же ошибку в Android studio. Я смог решить ее, запустив Build ->Очистить Проект в IDE.
Это из-за вашего длинного имени каталога проекта, который дает вам очень длинный CLASSPATH в целом. Либо вам нужно уменьшить банки, добавленные в CLASSPATH (убедитесь, что удаление ненужных банок только) или лучший способ, чтобы уменьшить каталог проекта и импортировать проект снова. Это позволит уменьшить CLASSPATH . Это сработало для меня.
У меня была та же проблема,но вместо этого я использовал netbeans.
Я нашел решение, поэтому я делюсь здесь, потому что я нигде не нашел этого,поэтому,если у вас есть эта проблема в netbeans, попробуйте это:
(имена могут быть отключены, так как мой netbeans находится на португальском языке) Щелкните правой кнопкой мыши проект > свойства > сборка > компиляция > снимите флажок запустить компиляцию на внешней виртуальной машине.
Источник
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:
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
Поделиться
Ещё вопросы
- 0Как я могу отобразить все видео в каталоге через HTML5 и PHP?
- 0Как рассчитать время приема-передачи для пакета ICMP
- 1Доступ к защищенной WebHDFS Kerberos без SPnego
- 0Ячейка таблицы HTML — восстановление значений
- 1Проблема записи на приложение для Android
- 1Есть ли способ ввести переменную шага огурца из области действия сценария в cucmber?
- 1Сохранить переменную в постбэках, но очистить / не сохранить на странице выхода
- 1Переменная окружения в Javascript (Gulp)
- 0Динамический частичный AngularJS в $ templateCache удаляется
- 1Как включить объект, который имеет общее свойство списка и свойство ссылочного типа в dapper?
- 0Мой JavaScript не проверяет радиовходы моей формы правильно
- 0получить идентификатор всех отмеченных флажков в div
- 1log4j — ОШИБКА, лог DEBUG?
- 1Как отправить запрос на экспресс-сервер из собственного приложения реагирования?
- 1почему response.redirect не может перенаправить страницу после истечения сеанса в global.aspx?
- 0Рассчитать сумму подписки новых пользователей MySQL
- 1Привязка к карте в универсальном приложении
- 1Ошибка с моим генератором паролей грубой силы (Java)
- 1Как использовать расширенный Jackson MapSerializer в Hashmap
- 1Случайная матрица: по индексу i, j найти те же значения
- 1Что такое большое обозначение этих алгоритмов перестановки
- 0Intellisense: аргумент типа «HWND» несовместим с параметром типа «rawData :: HWND»
- 0Сообщение проверки Jquery не работает
- 0Segfault при использовании std :: string.c_str () в качестве аргумента для другого метода
- 0Ошибка со структурой инициализации в C ++
- 1Цепочка обещаний не в состоянии
- 0Javascript Заполнить скрытый ввод HTML с помощью JSON и указать кавычки при отправке на серверную часть
- 1Maven-Shade-плагин: сделать банку, а мы на войне Проект?
- 0AngularJS как получить логическое значение
- 1Я сделал класс для развлечения, но он действительно быстро исчерпал кучу места?
- 1Функция простой практики отображает NaN
- 0Проблема с кислородом: все главы 0
- 0получить данные таблицы, если совпадение полей с использованием codeigniter
- 1Python re.sub захватывает одного персонажа из группы
- 1Могу ли я использовать тот же dbcontext для идентификации asp
- 0Как сделать Regex для href?
- 1Возврат данных из диалога
- 1Является ли формат файла конфигурации DRBD стандартным?
- 1Вызов PICK_CONTACT Намерение не от Действия
- 1Свойство ‘do’ не существует для типа ‘Подписка’
- 1Android TableLayout проблема: горизонтальный скроллер выходит за пределы правой стороны экрана
- 0Может ли jQuery добавить что-то конкретное ВНУТРИ URL?
- 0Использование std :: begin (collection) против collection.begin () в C ++
- 1Процесс запущен, ошибок нет, активность не видна на Android> 1.6
- 1Содержимое файла в байтовом массиве?
- 0C ++ стандартная альтернатива itoa () для преобразования int в base 10 char *
- 1Получить RadGrid Выбранный элемент Индекс строки
- 0скрыть чувствительный код в проекте C ++
- 1В моем коде произошла ошибка, однако я не могу определить причину. (getpixel () принимает 2 позиционных аргумента, но 3 было дано)
- 1Ошибка возврата нулевого значения DataAdapter.fill
When i am trying to build this on windows bamboo agent it keeps on failing with below message.
when i put my code in same directory near to java8 jdk and execute the gradle build from cmd it works fine.
so it looks like the path that we are using in the bamboo is too long to process on windows agent.
bamboo build failing
«C:devjava8jdkbinjava.exe» (in directory «C:bamboo3xml-databuild-dirTARGET-PROJECT-JOB1»)
manually working
«C:devjava8jdkbinjava.exe» (in directory «C:devjava8my_code_repo»)
Error message
error 11-Oct-2018 03:28:20 at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
error 11-Oct-2018 03:28:20 at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:67)
error 11-Oct-2018 03:28:20 … 4 more
error 11-Oct-2018 03:28:20 Caused by: java.io.IOException: Cannot run program «C:devjava8jdkbinjava.exe» (in directory «C:bamboo3xml-databuild-dirTARGET-PROJECT-JOB1»): CreateProcess error=206, The filename or extension is too long
error 11-Oct-2018 03:28:20 at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
error 11-Oct-2018 03:28:20 … 7 more
error 11-Oct-2018 03:28:20 Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
error 11-Oct-2018 03:28:20 … 8 more
error 11-Oct-2018 03:28:20
error 11-Oct-2018 03:28:20
error 11-Oct-2018 03:28:20 * Get more help at https://help.gradle.org
error 11-Oct-2018 03:28:20
build 11-Oct-2018 03:28:20 6 actionable tasks: 6 executed
error 11-Oct-2018 03:28:20 BUILD FAILED in 2m 23s
build 11-Oct-2018 03:28:21 Stopped 1 worker daemon(s).
3 answers
1 accepted
Suggest an answer
Still have a question?
Get fast answers from people who know.