Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
Alfredo2828
Posts: 58
Registered: ‎03-23-2011
My Device: 9800
My Carrier: programmer
Accepted Solution

Error: Cannot run program "jar": CreateProcess error=2

Hi,

this error appears me when I insert an imagefield referring to an image. To my surprise, I do the same with the same image before and I ran before. When I comment the second imagefield, this run, of course. But... this shoudn't be happening.

 

The first imagefield(when all run):

        bitmapAux = Bitmap.getBitmapResource("9000.jpeg");
        bitmap = new Bitmap(100,100);
        bitmapAux.scaleInto(bitmap, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_STRETCH);
        imgField = new BitmapField(bitmap);

 

The second one(not work):

        Bitmap i_Logo = Bitmap.getBitmapResource("9000.jpeg");
        Bitmap ilogoaux = new Bitmap(100,100);
        i_Logo.scaleInto(ilogoaux, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_STRETCH);
        BitmapField   iField_Logo = new BitmapField(ilogoaux,BitmapField.FOCUSABLE)
       {
            protected boolean navigationClick(int status, int time)
           {
               fieldChangeNotify(1);
               return true;
       }};
          iField_Logo.isFocus();
          iField_Logo.setChangeListener(this);

 

Coud someone help me?

Thanks,

Alfred

 

Please use plain text.
Regular Contributor
Alfredo2828
Posts: 58
Registered: ‎03-23-2011
My Device: 9800
My Carrier: programmer

Re: Error: Cannot run program "jar": CreateProcess error=2

Hi,

I've noticed that this just appears when I overwrite the method navigationClick of the bitmapfield but when I comment it, the app work:

         iField_Logo = new BitmapField(ilogoaux,BitmapField.FOCUSABLE);
       /*{
            protected boolean navigationClick(int status, int time)
           {
               fieldChangeNotify(1);
               //Dialog.inform("ooeeeaaaaa");
                return true;
       }};*/
          //iField_Logo.isFocus();
          iField_Logo.setChangeListener(this);

 

Why? And, then, can not I do an image as a button?...

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Error: Cannot run program "jar": CreateProcess error=2

How big is your application?  How many classes are involved?  Have you searched the forum and looked at the other Threads with the same issue.

Please use plain text.
Regular Contributor
Alfredo2828
Posts: 58
Registered: ‎03-23-2011
My Device: 9800
My Carrier: programmer

Re: Error: Cannot run program "jar": CreateProcess error=2

Hi peter,

well, the project has 27 classes, but, in this process, in this case, I just use 2 or 3.

Maybe, it's because of the number of projects that I have in the workspace. I've read in some threads that it could be that, but it would be very strange, wouldn't it?

Yes, I've been searching threads about this issue, but it's a mess. Some people say what I've told you before, others if it could be the path, others say: uninstall and reinstall... I don't know what to do...

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Error: Cannot run program "jar": CreateProcess error=2

What is the full error message you are receiving?  Do you have a long path to your workspace?  If so try moving the workspace closer to your root folder.

 

Also ensure that your java environment is setup correctly.

 

I/O Error: CreateProcess

http://supportforums.blackberry.com/t5/Java-Development/I-O-Error-CreateProcess/ta-p/445949

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
welsenKiriono
Posts: 202
Registered: ‎04-19-2011
My Device: Blackberry Bold 9780
My Carrier: TAM

Re: Error: Cannot run program "jar": CreateProcess error=2

How about setting your environment to add java bin path...

 

Environmental Variable :

My Computer->Right Click Properties ->Advanced->Environment variable->System Variables -> Path -> Append the string in the End of Variable Value "C:\Program Files\Java\jdk1.6.0_21\bin" the installation path of Java

Please use plain text.
Regular Contributor
Alfredo2828
Posts: 58
Registered: ‎03-23-2011
My Device: 9800
My Carrier: programmer

Re: Error: Cannot run program "jar": CreateProcess error=2

Hi,

the complete message is the following: "Cannot run program "jar": CreateProcess error=2, The system can not find the specified file. BlackBerry Packaging Problem".

The path to the workspace isn't  too long:"C:\Documents and Settings\program01\workspace".

And the java environment is setup correctly:"My Computer->Right Click Properties ->Advanced->Environment variable->System Variables -> Path -> Append the string in the End of Variable Value "C:\Program Files\Java\jdk1.6.0_21\bin" the installation path of Java".

 

But, well, in the end, the problem is solved at the moment.

I do the following: just moving the jar.exe from jdk to jre. :smileyhappy:

Please use plain text.