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

回眸只為那壹抹淺笑 提交于 2019-12-13 21:24:43

问题


I have large number of class files , with field managers.I am getting this error Re: I/O Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified, on running the app.If i am excluding some classes it works fine for me ..Please suggest me how to resolve this error .


回答1:


I have experienced the exact same issue with a project that contained a lot of classes. Due to the increase in the number of classes, the java jar file moves away from the root which causes issues in compiling.

I was lucky to resolve this error. This link has been very helpful from BlackBerry Support Forums. The following steps resolved my issue:

  1. Right Click My Computer. Go To Properties.
  2. Click Advanced System Settings.
  3. Click Environment Variable
  4. Highlight PATH and click Edit. Add C:\Program Files (x86)\Java\jdk1.6.0_26\bin; to the start of the PATH.

Step 4 adds the java jar file to the PATH variable and adds it closer to the root. Adding closer to the root is helpful when compiling a project with several classes.




回答2:


The number of classes may not the issue. This may be caused by the BlackBerry packager not finding jar.exe.

The default C:\ProgramData\Oracle\Java\javapath is prepended to the PATH environment variable on Windows. This ‘javapath’ doesn’t seem to exist on in the File Explorer but can be seen in the (cygwin) shell. This directory only contains symlinks for java.exe, javaw.exe and javaws.exe but not jar.exe.

The previous answer is the correct solution and worked for me. Changing the PATH Environment Variable to prepend to the location of the JDK rather than ‘javapath’ or the JRE would allow Eclipse to find to the jar executable.



来源:https://stackoverflow.com/questions/17541630/blackberry-error-cannot-run-program-jar-createprocess-error-2-the-system-ca

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!