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

瘦欲@ 提交于 2019-12-08 05:05:30

I was lucky to resolve this error. This link has been very helpful from BlackBerry Support Forums. For anyone else facing the same issue, 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.

As the error says Cannot run program "jar" under Windows that means it cannot find the jar.exe executable file.

The problem, at least in my case, was that JAVA_HOME was pointing to the JRE on my computer (where there is no jar.exe in its "bin" folder) and not to the JDK where the jar.exe resides under its "bin" folder.

The solution was very simple - changed JAVA_HOME to point to the JDK root folder - in my case that was "C:\Program Files\Java\jdk1.7.0_15".

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