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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 15
Registered: ‎10-19-2010
My Device: Not Specified

RAPC fails when command line is too long

Hi folks,

 

I have a very large project that I'm trying to compile, but it's failing because the command line when rapc invokes javac is too long.  I'm getting an IOException from rapc, which goes away if I remove a small number of source files or make the paths to the source files shorter (eg, by shortening a package name)

 

My ant build script uses the generateSourceList="true" attribute for the <rapc> task, which means that instead of passing a huge command line to rapc, only an @sources.txt file is included, which contains a list of all the source files.  However, when rapc invokes javac, it does not use a sources file; it always puts the source files on the command line, which causes it to fail.

 

Has anyone come across this before? Any workarounds?  I've tried compiling my source manually via javac and jar before passing it in to rapc, so that I wouldn't have to use a long list of sources in rapc, but since I use resource files I can't call javac before rapc does its code generation stage.

 

Thanks all,

Jason

Contributor
Posts: 22
Registered: ‎08-10-2010
My Device: 9550

Re: RAPC fails when command line is too long

Check if JDK path is set in environment variables.

 

And java command is working in command prompt

Contributor
Posts: 15
Registered: ‎10-19-2010
My Device: Not Specified

Re: RAPC fails when command line is too long

Yup, everything is working fine, it's just the length of the command line that rapc uses to shell out to javac. If I remove a couple of java files, everything compiles wonderfully.
Visitor
Posts: 1
Registered: ‎03-23-2012
My Device: Developer
My Carrier: Developer

Re: RAPC fails when command line is too long

I am also having the exact same problem. By turning on the verbose option for rapc, I can see that it's just generating a command line with absolute paths to each one of my source files. Which, since I have a couple hundred source files, and they're pretty deep in my file structure (thanks ClearCase!), means that this command line is something like 10K long, which Windows is just unwilling to deal with.

 

This is DESPITE the fact that rapc itself is accepting the list of sources as a sources file i.e. @sources.txt. So suggesting this will Not Help, because I'm already doing it. In fact, my situation appears to be exactly the same as jsadler's. If I didn't know better, I'd think we're working on the same project, but I'm pretty sure he doesn't work here. But we're in exactly the same boat: big project, Ant build script using a <rapc> task with generateSourceList="true", resource files prevent pre-building into a jar and passing that to rapc. And of course rapc itself is closed and obfuscated to defeat decompilers, so I can't easily fix it there by reverse-engineering (not that I would, since it's probably against the terms of use).

 

If it matters I'm using version 5 of the component pack, where rapc is coming from; upgrading to version 7 is not an option right now.

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: RAPC fails when command line is too long

This has long been an issue and the only options I know are to shorten the length of the command line or separate the project into multiple projects. I don't know if RAPC imposes further limitations but the length of the command line is dependent on the OS.