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
New Developer
kaldor
Posts: 4
Registered: ‎10-02-2008
My Device: Not Specified

How to use rapc on Unix/Linux ?

[ Edited ]

Hi !

 

I have a probleme porting an app from j2me to blackberry. I used rapc.exe on Windows to build a .cod with my midlet and it worked well.

 

But now i need to do that on a unix server. I copied rapc.jar in the folder containing my midel and executed that :

 

java rapc.jar import=net_rim_api.jar codename=WebTest -midlet jad=WebTest.jad WebTest.jar

 

But it returns :

 

 

Exception in thread "main" java.lang.NoClassDefFoundError: rapc/jar

 

Do someone has a solution for me ?

 

 

PS : excuse me for the mistakes, i'm french and i dont speak very well english.

Message Edited by kaldor on 10-02-2008 11:55 AM
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: How to use rapc on Unix/Linux ?

Did this work on windoze? The "/" indicates it is taking rapc.jar as a qualified class name and trying to call main().

Obviously, the CLASS LOADER can't find rapc.jar on the classpath. You need to fix the java invokation syntax.

I've never actually tried to do this as I've had good luck with cygwin and don't have debian handy right now.

I thought you needed things like rapc.EXE but that would be great if the essentials are either java or sun tools.

 

Presumably this would work if I had files and a more complete classpath 

 

$ java -classpath "./rapc.jar" net.rim.tools.compiler.Compiler
Error: no files to process

Please use plain text.
New Developer
kaldor
Posts: 4
Registered: ‎10-02-2008
My Device: Not Specified

Re: How to use rapc on Unix/Linux ?

Up :smileyhappy:
Please use plain text.
New Developer
kaldor
Posts: 4
Registered: ‎10-02-2008
My Device: Not Specified

Re: How to use rapc on Unix/Linux ?

On Windows i used a batch that do this :

 

:RUN @"C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\bin\rapc" import="C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\lib\net_rim_api.jar" codename=WebTest -midlet jad=WebTest.jad WebTest.jar

 

 

It works perfectly but it call rapc.exe, and obviously i can't use it on a unix platform, so i though i could user rapc.jar but it dont seems to work, or i don't use it well.

Please use plain text.
New Developer
kaldor
Posts: 4
Registered: ‎10-02-2008
My Device: Not Specified

Re: How to use rapc on Unix/Linux ?

It Works !

 

I just wrote that script : 

 

 

#!/bin/bash # Classpath du JDE blackberry RIM=/home/dev/davy/blackberry/MDS/classpath java -jar $RIM/rapc.jar import=$RIM/net_rim_api.jar codename=$1 -midlet jad=$1.jad $1.jar

 

It seems i was not using the good rapc.jar.

 

 

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: How to use rapc on Unix/Linux ?

"-jar" works because the manifest points to the compiler.

 

Please use plain text.
New Developer
jacque
Posts: 2
Registered: ‎11-14-2008
My Device: Not Specified

Re: How to use rapc on Unix/Linux ?

Hi. Could you provide steps how to build applicacation under Unix. In invoking of rapc I don't see classpath at all. How to specify it?

Please use plain text.
Developer
amahfouz
Posts: 29
Registered: ‎06-23-2009
My Device: Not Specified

Re: How to use rapc on Unix/Linux ?

What is the recommended way for running rapc on UNIX?

 

I found postings such as

 

http://codeforfun.wordpress.com/2008/09/09/how-to-use-rapc-from-rim-dirty-details/

 

that suggest it is not possible to do that for JDE versions prior to 4.1.

Please use plain text.