Sincere, of course. I haven't programmed in Java since about 1996, and I never did hear of anyone doing so on an Arduino.
Just to be sure we are on the same page... You were running the Java code and Netbeans (no idea what that is), on the Arduino, right?
If the answer to my question regarding #4 is "Yes" then I would suspect that the Java and the parts translated into C++ differ in some way. I have no idea whether it's a difference in code, or perhaps a difference in speed, register usage, memory usage/fragmentation, or what, but a difference there must be.
Okay, I think that's where a lot of the miscommunication is. Netbeans is a separate IDE, and I translated to java because I know that that IDE allows for running the code line-by-line in java. I tried in C++, but I couldn't get gdb (C++ debugger) to work properly.
I'd look at getting the RAM usage down - "byte" instead of "int" for the large arrays at the very least.
I did that at the suggestion of one of the earlier posters. It helped a lot in terms of total memory used, but still hasn't resolved the issue.
@Iar3y, I think the OP means that he wrote an "identical" program in Java on a PC as the PC environment provides an easier way to check that the logic is correct. I can empathize with that approach (although I find Java even more obscure than Arduino C++).
Of course it is also perfectly valid to wonder how many errors crept in while the code was converted from Java to C++.
I actually kept them separate. I copied my C++ code from Arduino IDE into a java application in Netbeans and went through to fix all the programmatic problems (e.g. changing "int temp;" to "int temp = new int;" So I then went through and got the printout to be as I thought it should, taking notes of everything I had to change. Then, instead of copying the code over and re-translating it, I just went through my notes one-by-one and implemented them in C++, so there's no way any java "crept in."
If, by "line by line" debugging you mean single-stepping through the code, that just isn't possible with the Arduino (except perhaps with some esoteric hardware and software). Which is another reason why a complex project has to have debugging built in. The normal way to debug Arduino code is to use Serial.println() in various places (perhaps many places) so you can follow the logic and check intermediate values are what they should be.
I honestly didn't know about printing to Serial until this thread, so I'll definitely give that a shot next. Thanks!