795oma
Last Updated: February 10, 2017
·
24.71K
· ihcsim
130921 tcl 103 s

Eclipse/JUnit CreateProcess error=206. Filename or extension is too long.

Bump into this today while trying to run some junit tests from within eclipse (helios) on Windows 7.

Error:

java.io.IOException: Cannot run program "C:\Program Files\Java\jre6\bin\javaw.exe" (in directory ""): CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at org.eclipse.debug.core.DebugPlugin.exec(DebugPlugin.java:818)
at org.eclipse.jdt.launching.AbstractVMRunner.exec(AbstractVMRunner.java:73)
at org.eclipse.jdt.internal.launching.StandardVMRunner.run(StandardVMRunner.java:317)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:174)
....

Two solutions

  • Eclipse patches:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=327193

  • Shorten classpath:

http://stackoverflow.com/questions/201816/how-to-set-a-long-java-classpath-in-msdos-windows

To apply the Eclipse patches:

  • Download bug3271933.4.2hack.zip from the above link
  • Back up existing eclipse/plugins/org.eclipse.jdt.launching_3.4.*.jar
  • Copy and paste classes in the patch to org/eclipse/jdt/internal/launching in your org.eclipse.jdt.launching JAR (replace existing files)
  • Edit the META-INF /MANIFEST.MF file in your org.eclipse.jdt.launching JAR file by removing everything starting from the first "NAME:" entry. Make sure you leave two (2) line break characters at the end of the file.
  • Re-start eclipse

Hope this helps if you can't find an easier solution.

23 Responses
Add your response

866

Hi,

I tried to use the patch by following the above steps and the issue still exists. My eclipse version is Juno and OS is Windows 7. Could you please let me know if I have to use another patch? I also tried to map C:\ccviews\jpannikkview15\ccrs_new" to another drive to reduce the class path length. Still no luck.

If yo could let me know if there is another way to resolve this issue, I really appreciate it.

Thanks,
Jaya

over 1 year ago ·
867
130921 tcl 103 s

@jpannikk c:\ccviews\jpannikkview15\ccrs_new doesn't look like a long path to me. Does your classpath includes long paths? Can you try a quick experiment by copying your test codes to a shorter path to see if that works?
Assuming you copied all the classes in the patch to the right location under the Eclipse home folder, it should work after a restart.
Let me know how it goes.

over 1 year ago ·
868
130921 tcl 103 s

@jpannikk Also, which patch did you use? I used the bug3271933.4.2hack.zip (dated 2012-08-15) patch.

over 1 year ago ·
871

Hi,
I used the same patch.

Thanks,
Jaya

over 1 year ago ·
934
130921 tcl 103 s

@jpannikk Can you write your tests outside of eclipse, say using maven?

over 1 year ago ·
1816

Hi , This post really helps to solve my problem which i was facing for very long time.Great work...
Thanks much

over 1 year ago ·
1818
130921 tcl 103 s

@dpkkaruna can i get an upvote then? :-)

over 1 year ago ·
1824

Done :)

over 1 year ago ·
4497

This helped us a lot. Amazing how a relatively simple trick saves plenty of developer's time. Thanks!

over 1 year ago ·
4502
130921 tcl 103 s

@javicka Glad it helps. Can I get an upvote on the protip please?

over 1 year ago ·
5309

you saved the day thank you , i just followed the instructions you had said , works well . but what problem did you exactly address i am just curious.

over 1 year ago ·
12862

This was really very helpful.

Keep doing the best work.

over 1 year ago ·
14832
0f08e109caa770a078ffc2c57285e860

Thanks a lot! Applying the Eclipse patches works!

over 1 year ago ·
17810
None

Try " Long Path Tool " is also useful in situations where you see these error messages:
Cannot read from source file or disk, there has been a sharing violation,
cannot delete file or folder, the file name you specified is not valid or too long,
the source or destination file may be in use and many other file managing errors that you encounter in your computing use.

over 1 year ago ·
23393
None

Try to long path tool. It is very helpful.

over 1 year ago ·
28042

Use "Long path tool" to solve the error like deleting, renaming, copying etc.......

9 months ago ·
28056

“Long Path Tool” is very helpful for this error !
You can use to solve this problem

9 months ago ·
28075

Long path error!
"Long path tool" is very helpful for this problem. You can solve this problem like copy, delete, long path files by using this tool.
I used to have similar problems too, but after using "long path tool" everything was solved.

8 months ago ·
28101

Use Long Path Tool, Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.

8 months ago ·
28230

Long path tool is the very good program for error, unlock solution.
Try it and solve your problem.
I used long path tool and I solve my error, unlock problem solution.

7 months ago ·
28252

errrhhhh

6 months ago ·
28253

Long Path tool is a great tool for fixing problem.

6 months ago ·
28597

Hello,

I had the same problem. I didn´t know what to do so I searched on the internet for some solutions.

And I read about [b]Long Path Tool[/b], which is a great tool in these type of cases. :o

It worked really well. Hope it works for you too :p

2 months ago ·