CBCJVM Problems

4 replies [Last post]
Austin_B
Title: NooBot
Joined: 07/30/2012
Posts:
BotPoints: 17
User offline. Last seen 9 years 37 weeks ago.

Some of the issues I have with programming with the CBCJVM on Windows 7 with KISS IDE 3.0.2:

  • Compiling will succeed, but hitting Simulate will (not always, but most of the time), bring up error: Error: Could not find or load main class Main
  • Compiling will also succeed with programs that import libraries (e.g., cbccore.motors.Motor), but upon clicking Simulate, the error java.lang.NoClassDefFoundError comes up.

I have came up with these errors with the examples, if that would cause any of this.
Also, with the HelloWorld example, I can go in command prompt and use the javac command to compile and then run (also in command prompt). Doing this does not necessarily guarantee that clicking Simulate in the IDE will run without error.
Thank you for any and all help! I would love to start programming the CBC in Java!

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 32 weeks ago.

The first one is a known issue with CBCJVM and "Simulate". They should not occur if you are downloading to a robot. I developed CBCJVM three years before KISS IDE, and CBCJVM was meant to work with Eclipse natively, not KISS IDE. This error will occur every other "Simulate," so simply pressing "Simulate" again should work.

The second one is interesting. I would confirm that the CBCJVM jar is located in your ${KISS INSTALL DIR}/targets/java/lib folder. I don't think it should compile if there are classes missing from the path... hmm.. If all else fails, I would recommend using Eclipse and using a flash drive. The File Manager should allow you to click on any .class and run it.

Apologies for this. KISS IDE 4 should address these issues, since I am abandoning CBCJVM in favor of an auto-generated libkovan wrapper. This will prevent the java api from ever falling behind the C/C++ ones.

Thanks.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

Austin_B
Title: NooBot
Joined: 07/30/2012
Posts:
BotPoints: 17
User offline. Last seen 9 years 37 weeks ago.

In the targets folder, there are these folders:

cbc2
gcc
java

Is the java folder supposed to be named cbcjvm? Should I just rename it?

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 32 weeks ago.

Errr... java. That's right. Sorry :P Been on the KISS IDE 4 branch for a while.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

Austin_B
Title: NooBot
Joined: 07/30/2012
Posts:
BotPoints: 17
User offline. Last seen 9 years 37 weeks ago.

Is there any known reason why it would give that error, if the jar is in the correct place?