CreateProcess error=206, 运行 main() 方法时文件名或扩展名太长 [英] CreateProcess error=206, The filename or extension is too long when running main() method
问题描述
我在 eclipse helios 中有这个错误:
I have this error in eclipse helios:
执行命令行时发生异常.无法运行程序C:Program Files (x86)Javajre6injavaw.exe"(在目录C:Usersmotiverhelios_workspaceTimeTracker"中):CreateProcess error=206,文件名或扩展名是太长了
我进行了一些研究,但在使用 Google App Engine 时,大多数问题都与 DataNucleus 相关.但我没有使用任何与 Google App Engine 远程相关的东西.我正在 JBOSS 6 上使用 Servlet 3.0 做一个小项目.我使用 Hibernate 4.1.2 for ORM 和 RESTEasy 来公开 Web 服务.我创建了一个具有 main() 方法的 util 文件,该方法基本上删除并重新创建了架构.当我需要一个干净的数据库进行测试时,我会运行 main() 方法.它在 Tomcat 7 上运行良好,但当我转移到 JBoss 6 时它停止工作.
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.
推荐答案
这个问题没有简单的解决方案(比如几次点击或一个简单的命令).
There is no simple (as in a couple of clicks or a simple command) solution to this issue.
引用Eclipse.org 中的这个错误报告,这些是变通方法.选择对您来说最不痛苦的那个:
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:
- 减少类路径
- 使用目录而不是 jar 文件
- 使用包含所有其他 jar 的打包 jar 文件,使用清单文件中的类路径变量指向其他 jar
- 使用特殊的类加载器从配置文件中读取类路径
- 尝试使用错误报告文档中随附的补丁之一
- 使用自己的包装器,例如蚂蚁
更新:2014 年 7 月之后,有更好的方法(感谢 @Brad-Mace 在下面的回答:
Update: After July 2014, there is a better way (thanks to @Brad-Mace's answer below:
如果您创建了自己的构建文件而不是使用 Project ->生成Javadocs
,然后可以在Javadoc任务中添加useexternalfile="yes"
,专门解决这个问题.
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.
这篇关于CreateProcess error=206, 运行 main() 方法时文件名或扩展名太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!