Reputation: 199
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 .
Upvotes: 0
Views: 1240
Reputation: 1228
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.
Upvotes: 0
Reputation: 1905
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:
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.
Upvotes: 3