blackberry - BlackBerry无法运行程序 “jar” : CreateProcess error=2, The system cannot find the file specified

标签 blackberry jar compiler-errors executable-jar

我正在开发带有许多类文件的BlackBerry Application。目前有16个Java类,并且由于该应用程序具有许多屏幕和功能而非常复杂,因此它们还在不断增加。我正在使用BlackBerry Java Plug-in在Eclipse中工作。我正在使用BlackBerry JRE 6.0。我最近开始收到以下错误:

Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified



我有这个错误的Google,很多人认为这是Java环境变量路径引起的。但是,我检查了一下,到此为止一切似乎都还不错。我注意到,当增加类的数量或增加类的长度时,会发生此错误。我通过减少项目中的类数来消除错误。我创建了单独的项目,在每个项目之间划分了类,并且编译良好。因此,我可以相信源代码没有问题。

任何人都可以在包含多个类的单个项目中指导如何克服此错误。请帮忙。

编辑:我在BlackBerry支持论坛上遇到了以下内容:

"I think the most common reason for this (assuming that you have the JDK installed) is a large number of files in the project, and/or a project directory that is very far from the root.

The issue is that the RAPC compiler calls the JAR utility, building a command line that consists of all the class files in the application. If the command line length exceeds the maximum length allowed by the system, you will get this error."



如何解决这个问题,这是造成它的原因。

最佳答案

我很幸运能够解决此错误。 This链接对BlackBerry支持论坛非常有帮助。对于其他遇到相同问题的人,以下步骤可以解决我的问题:

  • 右键单击“我的电脑”。转到属性。
  • 单击高级系统设置。
  • 单击环境变量
  • 突出显示PATH,然后单击Edit。添加C:\ Program Files(x86)\ Java \ jdk1.6.0_26 \ bin;到PATH的开头。

  • 步骤4将Java jar文件添加到PATH变量,并将其添加到更接近根的位置。在编译具有多个类的项目时,将根添加得更近些很有帮助。

    关于blackberry - BlackBerry无法运行程序 “jar” : CreateProcess error=2, The system cannot find the file specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14918853/

    相关文章:

    blackberry - 在 Blackberry 中创建对话框

    android - Android Studio-如何导出包含其他jar的jar?

    java - “找不到符号”或“无法解析符号”错误是什么意思?

    c++ - C++函数返回错误的数据类型

    eclipse - 错误: Cannot run program "jar": CreateProcess error=2,系统找不到指定的文件

    javascript - 用于黑莓的 Cordova/Phonegap 插件

    javascript - 如何在黑莓浏览器上动态添加脚本元素?

    Java 程序不显示 Jar 中文本文件的内容

    java - 无法使用 Eclipse 更改 jFrame 图标/加载 .jar 的资源

    c++ - 在 Qt 中创建模型时出现多个错误