Java createprocess error 206 the filename or extension is too long

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’m trying to call Findbugs via Ant, but receiving this error:

Cannot run program "C:Program Files (x86)Javajre6binjavaw.exe" (in 
directory "H:UsersMyNameworkspaceMyProject"): 
CreateProcess error=206, The filename or extension is too long

How can I fix this? o.O

asked Jan 13, 2012 at 12:57

sonnuforevis's user avatar

sonnuforevissonnuforevis

1,3116 gold badges21 silver badges38 bronze badges

3

I had the same problem.
I used

<fileset dir="${basedir}/build">
  <include name="**/*.class"/>
</fileset>

inside findbugs target and it seems that there is too much .class files to be passed to findbug (?via command line?) because when I used

<fileset dir="${basedir}/build/com/domain/package">
  <include name="**/*.class"/>
</fileset>

that had low number of classes, the error was gone.

So, I solved the problem by making one jar file and feeding it to findbugs target with

<findbugs home="${findbugs.home}">
  ...
  <class location="${basedir}/targets/classes-to-analyze.jar"/>
</findbugs>

answered Feb 9, 2012 at 17:06

Yuri's user avatar

1

I think one of the effective file paths are really long when java tries to compile clases.

One worth try is to put codebase in a directory such as C:MyProject instead of something like C:UsersMyNameworkspaceMyProject

answered Jul 17, 2015 at 4:51

user3333725's user avatar

To solve this issue you need to generate a manifestclasspath and a pathing jar.

First Generate your classpath.

<path id="javac.path">
    <fileset dir="lib/" includes="**/*.jar"/>
</path>

Next Generate your manifestclasspath

<target name="generate-manifest-classpath">
    <manifestclasspath property="manifest.classpath" jarfile="pathing.jar">
        <classpath refid="javac.path"/>
    </manifestclasspath>      
    <jar destfile="pathing.jar" basedir="${the location of your build classes}">
        <manifest>            
            <attribute name="Class-Path" value="${manifest.classpath}"/>
        </manifest>
    </jar>
    <path id="javac.classpath">
        <pathelement path="pathing.jar"/>          
    </path>
</target>

Next Implement your Manifestclasspath

<javac srcdir="${foo.dir}" destdir="${bar.dir}"
        <classpath refid="javac.classpath"/>
</javac>

This will solve the 206 error message if implemented correctly.

answered Oct 11, 2021 at 14:55

Steve-Buglione's user avatar

1

I had the same error on IntelliJ while starting debug mode only. To fix is I’ve changed:

Run > Edit Configurations > «Configuration» tab > Shorten command line

to «JAR-manifest»

answered Oct 21, 2020 at 12:36

Javoslaw's user avatar

JavoslawJavoslaw

3372 silver badges6 bronze badges

0

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.

Содержание

  1. CreateProcess error=206, имя файла или расширение слишком длинное при запуске метода main ()
  2. 14 ответов
  3. CreateProcess error=206, The filename or extension is too long when running main() method
  4. 30 Answers
  5. CreateProcess error=206, имя файла или расширение слишком длинное при запуске метода main
  6. 14 ответов:

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

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

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

Я немного исследовал, но большинство проблем были связаны с DataNucleus при работе над Google App Engine. Но я не использую ничего, отдаленно связанного с Google App Engine. Я делаю небольшой проект с сервлетом 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-ответ Мейса ниже:

Если вы создали свой собственный файл сборки вместо использования 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

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

по сообщению 327193 ошибка Он считается исправленным, но это случилось со мной недавно с Eclipse Kepler 4.3.2.

пожалуйста, скачайте патч для Eclipse Juno или новее:

  1. после загрузки резервное копирование существующих eclipse / Плагины / org.затмение.JDT, предназначенным.launching_3.*.Джар
  2. копировать и вставлять классы в патч в организацию.затмение.JDT, предназначенным.пусковой Яс (заменять существующий файл.)
  3. Перезапустить Eclipse.

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

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

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

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

java-jar-Dserver.port=8080 build/libs / APP_NAME_HERE.Джар

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

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

-enhancerName ASM-api JDO-pu MediaToGo

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

правильный ответ из этой темы был правильным ответом для моего особого случая. Укажите путь к папке ORM для datanucleus, безусловно, уменьшите компиляцию пути java.

Я получил ошибку ниже, когда я запускаю’развернуть АНТ

исправлено с помощью run’очистить муравей‘, прежде чем он.

Я получил ту же ошибку в Android studio. Я смог решить это, запустив Build ->Очистить Проект в IDE.

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

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

Источник

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

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.

30 Answers

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

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

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

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

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

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

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

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:

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

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

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:

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

Try updating your Eclipse version, the issue was closed recently (2013-03-12). Check the bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=327193

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

in javc of ant build file.

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

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:

  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.

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

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

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

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

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

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:

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

with its content:

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.

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

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.

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:

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 .

Add below to your gradle file:

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

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.

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

Источник

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 или новее:

  1. после загрузки резервное копирование существующих eclipse / plugins / org.затмение.JDT, предназначенным.launching_3.*.банку
  2. копирование и вставка классов в патч в организацию.затмение.JDT, предназначенным.запуск банку (заменять существующий файл.)
  3. Перезапустить 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 находится на португальском языке) Щелкните правой кнопкой мыши проект > свойства > сборка > компиляция > снимите флажок запустить компиляцию на внешней виртуальной машине.

Источник

score:58

Accepted answer

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.

score:-2

This is because of your long project directory name, which gives you a very long CLASSPATH altogether. Either you need to reduce jars added at CLASSPATH (make sure removing unnecessary jars only) Or the best way is to reduce the project directory and import the project again. This will reduce the CLASSPATH.
It worked for me.

score:-1

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.

score:-1

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

score:-1

I’ve had the same problem,but I was using netbeans instead.
I’ve found a solution so i’m sharing here because I haven’t found this anywhere,so if you have this problem on netbeans,try this:
(names might be off since my netbeans is in portuguese)
Right click project > properties > build > compiling > Uncheck run compilation on external VM.

score:0

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!

score:0

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.

score:0

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

score:0

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

score:0

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

score:0

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

score:1

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.

score:1

Try this:

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

score:1

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>

score:1

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.

score:1

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"

score:1

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

score:1

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

score:2

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.

score:3

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.

score:3

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.

score:6

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.

score:7

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.

score:8

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

score:18

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

score:20

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.

score:20

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

Related Query

  • CreateProcess error=206, The filename or extension is too long when running main() method
  • Createprocess error=206; the filename or extension is too long
  • Windows 10- In eclipse (Oxygen version), createProcess error=206, The filename or extension is too long
  • When executing proguard-maven-plugin, «CreateProcess error=206, The filename or extension is too long» occurs
  • «Could not find the main class» error when running jar exported by Eclipse
  • «Could not find the main class: MineAvtaler. Program will exit.» — Only when running outside Eclipse
  • Why am I getting the following error when running Google App from eclipse?
  • «No matching benchmarks» when running JMH from main in eclipse
  • Running Ant Build.xml getting: Java Virtual Machine Launcher: Could not find the main class. Program will exit
  • How to change the default C++ file extension in Eclipse CDT when creating a new file?
  • How to set the C++ file extension to .cc in Eclipse for files created when starting a new project?
  • How do I make an Eclipse plugin extension which displays different context menu items when the user clicks a marker?
  • What is the correct way to specify a main class when packaging a jar using m2eclipse?
  • TestNG problems when running the project
  • BufferedImage bytes have a different byte order, when running from Eclipse and the command line
  • Out of Memory (java heap) when running suite with too many test cases
  • I want to know when a program written by Java is running,its classes will be all loaded on the main memory?
  • Phonegap-Skipped 33 frames! The application may be doing too much work on its main thread
  • Need help linking a subproject to the main project when deploying it in eclipse
  • «Could not find the Main class» when opening a .jar file
  • SOAPFaultException: «None of the policy alternatives can be satisfied» , when running webservice client (ApacheCXF)
  • What are the main things that an experienced Java SWT programmer should be aware of when moving to Swing?
  • Azure Eclipse : cspack.exe: Error : The specified path, file name, or both are too long
  • For loop ends itself and terminates the running program but runs correctly when the slope calculation statement is removed
  • UnsatisfiedLinkError in Eclipse when running the COMSOL Java API
  • Application not opening with url as in the war name when running in eclipse server
  • this.getClass().getResource(«»).getFile() returning path with «file:» at the beginning when running project with IntelliJ/Jetty 8.1.14
  • When do files in the Android getCacheDir() get deleted? What is a better option for long term storage?
  • Eclipse RCP: Why is the view missing when running as a Product?
  • «projectId must match the following pattern» exception when running Objectify on Google Cloud tools for Eclipse

More Query from same tag

  • eclipse error: Failed to install SAN.apk on device ’emulator-5554′: No such file or directory
  • how to make a new eclipse project (as a plugin)
  • Convert all strings to lowercase in a scala code in Eclipse
  • Using a python module in Java through Jython but I am very new to paths and how to configure them
  • How to switch from Button to FrameLayout based on login status
  • Retrieving artifact release date using Aether Eclipse
  • Eclipse Android Plugins
  • running applet via ant from eclipse
  • Hibernate code generation does not create EJB3 annotation on export
  • Is there a way to make Eclipse+PyDev display function documentation like Python’s help() would?
  • Eclipse Project Expoloer Active Highlite Color
  • Cannot have two css files with same name in eclipse (liferay theme project)
  • How to space out items in a LinearLayout?
  • dynamic path in java application
  • File Upload Using Selenium WebDriver and Java on a Mac
  • What’s a good way to view dojo’s javascript source files in Eclipse with Aptana?
  • Eclipse Che — How to connect an existing Eclipse installation?
  • Android project referencing «normal» java project in eclipse since sdk tools update 17
  • java application is not running on jar after sorting in packages
  • Unable to debug using eclipse debugger
  • Annotation processing never be invoked
  • Must I build in order to get rid of error in Eclipse?
  • Failed to load JNI shared library
  • egit for eclipse: How do I put my existing project in the clone of my buddies repo?
  • Type ahead autocompletion in Eclipse
  • Error: «The import javafx.embed.swt cannot be resolved» on Eclipse plug-in export
  • How to launch an activity on phone call end?
  • How to migrate to Android Studio?
  • function only F8 doesn’t work during debug into eclipse
  • How to get the response by JUNIT with SOAPUI

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

People on a hot air balloon lifted by Community discussions

Still have a question?

Get fast answers from people who know.

Was this helpful?

Thanks!

Понравилась статья? Поделить с друзьями:
  • Java check error type
  • Java centos error could not create the java virtual machine
  • Java exe ошибка приложения
  • Java catch error type
  • Java catch any error