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
Highlighted
Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified
Accepted Solution

Build error caused by overrided paint() method

[ Edited ]

Hi Everyone,

 

When I build my active blackberry configuration, I am receiving the error:

 

 

I/O Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified
rapc executed for the project MyApplication

 

 

This happens when I have this code:

 

 

LabelField lblTitle = new LabelField(title) {
	protected void paint(Graphics graphics) {
		graphics.setColor(0x00FFFFFF);
		graphics.clear();
		super.paint(graphics);
	}
};

LabelField lblSubTitle = new LabelField(releaseYear + ", " + rating) { protected void paint(Graphics graphics) { graphics.setColor(0x00FFFFFF); graphics.clear(); super.paint(graphics); } }; vfmHeader.add(lblTitle); vfmHeader.add(lblSubTitle); screen.add(vfmHeader);

 

If I were to remove the overrided paint() method in the lblSubTitle LabelField, however, the build error does not show up. I tried changing lblSubTitle from a LabelField to a RichTextField, and I still receive the same error.

 

Very strange. Does anyone know why this is happening? Thanks!

 

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Build error caused by overrided paint() method

UPDATE: It seems that this is happening from too much UI code? Is this possible? If I keep in the code shown in my original post, and comment out some other UI code, it will work.

 

Also, I have another class which has a bunch of UI code and the same thing is happening. When I add a new Field, I get the error. But if I keep in that new field and comment out some other code, it will work.

 

Please tell me that there is some sort of solution for this...

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Build error caused by overrided paint() method

Split your code up into smaller classes?

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Build error caused by overrided paint() method

That's what I'm going to try, thanks.

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Build error caused by overrided paint() method

i created an additional 2 classes to split up my code. When I buld the active blackberry configuration, I am still receiving the error. If I comment out the code in the additional two classes and then build, it will do so successfully.

 

If I uncomment all of the code in the two classes and remove the overrided paint() methods, it will work.

 

So it seems that something about overriding the paint methods is causing the error. I am so confused as to why this would be happening. Any ideas, anyone?

 

Thanks.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Build error caused by overrided paint() method

What OS level are you compiling using?  Eclipse or JDE?

 

have you tried using another level?

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Build error caused by overrided paint() method

I am using Windows XP mode on Windows 7. I had tried using Windows 7 and Vista in the past, and simulator didn't seem to play nice with it.

 

I am using the Eclipse JDE plug-in.

 

I am currently installing XP on a spare desktop computer that I have, and I am going to try installing Java and the Eclipse JDE plug-in on that. Once that's all set up and configured, I plan to try and build my code on that machine...

 

Any other suggestions in the meanwhile?

 

Thanks!

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Build error caused by overrided paint() method

[ Edited ]

I have tried installing the BlackBerry Eclipse JDE Plug-In on another computer running Windows XP. I am still receiving the error, however it is providing more details:

 

 

I/O Error: CreateProcess: jar -cfm "C:\Documents and Settings\Kevin\workspace\.BlackBerry\..\MyApplication\MyApplication.jar" C:\DOCUME~1\Kevin\LOCALS~1\Temp\rapc_055a6b49.dir\META-INF\MANIFEST.MF -C ..\MyApplication MyApplication.cod -C ..\MyApplication MyApplication -1.cod -C ..\MyApplication MyApplication-2.cod -C ..\MyApplication\MyApplication.csl -C ..\MyApplication MyApplication.cso -C C:\DOCUME~1\Kevin\LOCALS~1\Temp\rapc_055a7b78.dir . error=2
rapc executed for the project MyApplication

 

 

I then opened up a command window and typed:

 

 

jar -cfm "C:\Documents and Settings\Kevin\workspace\.BlackBerry\..\MyApplication\MyApplication.jar"

 

 

Which gave me the following:

 

1627iCC22B5CD6F5BF080

 

What do you guys think? I really need to get this project back on track...

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Build error caused by overrided paint() method

I found the solution to my problem here:

 

http://www.blackberryforums.com/rim-software/79668-jde-build-all-problem.html

 

Basically, I removed all installed versions of Java that I had and I installed the following:

 

j2sdk-1_4_2_15-windows-i586-p.exe (JDK 1.4.2 version 15)
jdk-1_5_0_12-windows-i586-p.exe (JDK 1.5.0 version 12)

 

JDK 1.5.0 is needed because otherwise the Eclipse JDE plug-in will not start with 1.4.2.

 

Without having JDK 1.6, however, the MDS-CS will not launch (within Eclipse). So I had to manually download "BlackBerry Email and MDS Service Simulators 4.14", start it, and then run my application.

 

I hope that this can help somebody down the line...