BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Eclipse plugin, preverify step: I/O Error: Cannot run program "jar" (http://www.blackberryforums.com/developer-forum/201773-eclipse-plugin-preverify-step-i-o-error-cannot-run-program-jar.html)

2009.MOBILE 08-21-2009 09:36 PM

Eclipse plugin, preverify step: I/O Error: Cannot run program "jar"
 
Hi all,

When I preverify the BlackBerry app I'm developing using the Eclipse plugin, I get the following error:
Code:

I/O Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified
This is the same error described in this thread:
developer-forum/137911-i-o-error-cannot-run-program-jar-eclipse-plugin.html

However, I don't know how to fix it using the instructions in that thread. All I see in the Installed Components tree item of the BlackBerry Preferences window is "Choose one of installed Components", nothing about Java Home. Also, how do I modify a PATH variable as described?

Also, I don't think my problem is related to the BlackBerry Preferences as a whole messing up, because I have many projects and only some of them are getting this error, while others are preverifying without error. This is the output when I press Build Active BlackBerry Configuration (with project names edited out):

Code:

Executing rapc for the project [Project1] at Fri Aug 21 18:48:43 PDT 2009.
C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin\launcher.exe C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin\rapc.exe  -quiet import="..\..\..\..\..\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\lib\net_rim_api.jar" codename=..\[Project1]\[Project1] ..\[Project1]\[Project1].rapc warnkey=0x52435200 -sourceroot="C:\[...]\Workspace\[Project1]\src" @[Project1]_build.files
I/O Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified
rapc executed for the project [Project1]

Executing rapc for the project [Project2] at Fri Aug 21 18:41:01 PDT 2009.
C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin\launcher.exe C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin\rapc.exe  -quiet import=..\[Import1]\[Import1].jar;..\[Import2]\[Import2].jar;"..\..\..\..\..\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\lib\net_rim_api.jar" codename=..\[Project2]\[Project2] ..\[Project2]\[Project2].rapc warnkey=0x52435200 -sourceroot="C:\[...]\Workspace\[Project2]\src" "C:\[...]\Workspace\[Project2]\bin"
rapc executed for the project [Project2]

The second project succeeded but the first one failed. Notice that the second project uses imports, while the first one doesn't. I found the automatically-generated line @[Project1]_build.files in the first highly suspicious, since there's no similar string in the second.

What's going on if the problem is just happening with some, but not all, of my projects?

Thanks!

Jerry Brady 01-21-2010 11:39 AM

Same here...
 
I've been experiencing the same issues trying to package certain BlackBerry projects using Eclipse (4.5) and the BB IDE for Eclipse (1.1beta).

If a project doesn't have external libraries, things work okay for me, but my biggest project with external libraries causes this error while packaging the project.

As a workaround, I copied the failed command (display in the packaging console window) into a command prompt from the project's directory and it worked fine.

My system's path is set properly to pick up jar.exe from the installed JDK's bin directory and it's obvious that something in Eclipse isn't picking up the right paths and I am unsure where to set them myself.

sadohert 04-20-2010 05:22 AM

D'uh! The JDK needed to be installed...
 
Hey Guys,
I was having this issue...feel like an idiot now. I didn't actually install the jdk :oops:! Surprisingly I got as far as building and testing the RIM Samples and my own application with no problem. It wasn't until I went to test using a project that depends on another project. I'm guessing at this point Eclipse needed "jar" to put together the compiled code from the separate projects.

Anyway, once I installed the jdk I still wasn't quite there. I had to edit my Windows Environment PATH variable to have the path to the jdk bin directory. In my case it was:

C:\Program Files\Java\jdk1.6.0_20\bin

Save the variable change. Restart eclipse, and presto, off to the races.

Stu

Taurus084 05-11-2010 01:10 AM

Quote:

Originally Posted by sadohert (Post 1596810)
Hey Guys,
I was having this issue...feel like an idiot now. I didn't actually install the jdk :oops:! Surprisingly I got as far as building and testing the RIM Samples and my own application with no problem. It wasn't until I went to test using a project that depends on another project. I'm guessing at this point Eclipse needed "jar" to put together the compiled code from the separate projects.

Anyway, once I installed the jdk I still wasn't quite there. I had to edit my Windows Environment PATH variable to have the path to the jdk bin directory. In my case it was:

C:\Program Files\Java\jdk1.6.0_20\bin

Save the variable change. Restart eclipse, and presto, off to the races.

Stu


Thanks Stu, that worked!


All times are GMT -5. The time now is 08:33 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.