CreateProcess error=206, The filename or extension

2019-01-03 06:25发布

I have this error in eclipse helios:

Exception occurred executing command line. Cannot run program "C:\Program Files (x86)\Java\jre6\bin\javaw.exe" (in directory "C:\Users\motiver\helios_workspace\TimeTracker"): 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.

16条回答
聊天终结者
2楼-- · 2019-01-03 06:52

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
  • Move to IntelliJ (Update: as @nitind points out, this is not an option)

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.

查看更多
我想做一个坏孩纸
3楼-- · 2019-01-03 06:58

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

查看更多
三岁会撩人
4楼-- · 2019-01-03 07:00

Try this:

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

查看更多
不美不萌又怎样
5楼-- · 2019-01-03 07:00

I got the error below when I run 'ant deploy'

Cannot run program "C:\java\jdk1.8.0_45\bin\java.exe": CreateProcess error=206, The filename or extension is too long

Fixed it by run 'ant clean' before it.

查看更多
我命由我不由天
6楼-- · 2019-01-03 07:02

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.

查看更多
做个烂人
7楼-- · 2019-01-03 07:03

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.

查看更多
登录 后发表回答