Robocode Editor/Compiler troubles?

Jump to navigation Jump to search

Robocode Editor/Compiler troubles?

I've been using 1.6.1.4 for a very long time and never had any trouble with the editor. Since I am using 1.7.4.2 that editor has the annoying habit to put some rubbish at the end of the file, so I only use it to compile. Most of the time I use Araxis so I can quickly jump to the places I have been editing. Next to that, I am alas not very active, so an occasional fluke just gets forgotten.

GrubbmGait01:21, 7 March 2013

Thank you for trying to help.

Whenever I start-up Robocode, every robot in the database gets a "ClassNotFound" exception. At several, seemingly arbitrary points, (MostlyHarmlessNano, XanderCat...) it just freezes. I have to kill Robocode from the Task Manager if it doesn't resume in a few minutes.

When I compile from the Robot Editor, Robocode feels the need to go through the entire database again. And it has the same problems.

I've tried both cleaning the robot cache and deleting the database to make Robocode rebuild it, but neither had any effect.

I could post a sample of the console output tomorrow if it would help.

Sheldor02:10, 7 March 2013
 

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Users.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

Return to Thread:User talk:Sheldor/Robocode Editor/Compiler troubles?/reply (2).

 

If I copied all my robots to a different folder, uninstalled Robocode, reinstalled Robocode, and then copied the robots back, would the problem be fixed?

Sheldor21:38, 20 March 2013
 

Hmm, I know I've seen those kinds of errors before, but beyond clearing robots/.data and robots/robot.database and rebuilding, I'm not sure what to try. Can you actually run (eg) XanderCat 12.0.1 or is the bot itself broken too?

Certainly no harm in trying a fresh Robocode install. I've probably got like a dozen. :-)

Voidious21:55, 20 March 2013

The bots run fine when Robocode successfully starts-up.

I don't think the errors are causing the problem, but they might be symptoms of a larger issue.

Sheldor22:18, 20 March 2013
 

!@#$%^&*()!@##$$$%%%***^%^$#@!!@)$%%##**!*#$@!!*&()!!!!!!!!!!!!!!!!!!!!!!!!!!!

I deleted the robocode folder, reinstalled Robocode, deleted the robot.database file, and then tried to run it, and it still froze!

I really have no idea what's causing this. I did get a weird "OutOfMemoryError" today. It's interesting that the error occurred right after Aversari, which is one of the freezing points. It's also interesting that Roboode seems to get stuck at certain alphabetical points, not certain bots. See, for instance, that MostlyHarmlessNano used to be a freezing point, but now the bot right after it is.

Got an error with dz.MostlyHarmlessNano_2.1.dz.MostlyHarmlessNano: java.lang.Cla
ssNotFoundException: dz.MostlyHarmlessNano_2.1.dz.MostlyHarmlessNano
Got an error with dz.MostlyHarmlessNano_2.1.dz.MostlyHarmlessNano: java.lang.Cla
ssNotFoundException: dz.MostlyHarmlessNano_2.1.dz.MostlyHarmlessNano
Got an error with dz.MostlyHarmlessNano_2.1.dz.MostlyHarmlessNano: java.lang.Cla
ssNotFoundException: dz.MostlyHarmlessNano_2.1.dz.MostlyHarmlessNano
Got an error with froh.micro.Aversari_0.31.froh.micro.Aversari: java.lang.ClassN
otFoundException: froh.micro.Aversari_0.31.froh.micro.Aversari
Got an error with froh.micro.Aversari_0.31.froh.micro.Aversari: java.lang.ClassN
otFoundException: froh.micro.Aversari_0.31.froh.micro.Aversari
Got an error with froh.micro.Aversari_0.31.froh.micro.Aversari: java.lang.ClassN
otFoundException: froh.micro.Aversari_0.31.froh.micro.Aversari
UncaughtException on thread class java.lang.Thread:
java.lang.OutOfMemoryError: GC overhead limit exceeded
        at sun.java2d.d3d.D3DScreenUpdateManager.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Sheldor15:46, 21 March 2013
 

Hmm - it says: "java.lang.ClassNotFoundException: dz.MostlyHarmlessNano_2.1.dz.MostlyHarmlessNano", and all the other class names seem similarly warped. I think the class it should be looking for is just "dz.MostlyHarmlessNano". Could you check the filename of MostlyHarmlessNano's JAR? Is it dz.MostlyHarmlessNano_2.1.jar, or something else? I'm wondering if the RoboRumble client did something weird in downloading to the wrong filenames and it's throwing off the class names that Robocode expects to find.

Voidious16:05, 21 March 2013

You're right, it's just dz.MostlyHarmlessNano_2.1.jar. I wonder why Robocode is doing that?

I don't have a RoboRumble client, so it can't be that.

Sheldor16:53, 21 March 2013
 

I've noticed that strange things happen in the initialization code, for instance it runs my FastTrig init code in the Robocode startup, and if I put System.out.println() statements there they will be printed to the main console. I've been meaning to put in a bug report about this for a while now...

My suggestion is get rid of all the bots you don't need, and start with an empty install. Copy them in a few at a time until you figure out what is going wrong. Maybe just keep your own dev (ie. robocode/robots/sheldor/) directory, and keep extracted bots in a different directory that Robocode doesn't know about. BTW, putting bots in a .zip won't work, since new Robocodes look inside of .zip files for bots.

Skilgannon16:30, 21 March 2013

I tried your suggestion. Robocode still gets the errors, but now it goes through them in a matter of seconds, which I can accept.

Whenever I tried the Robot Editor, I got this message:

Please wait while Robocode sets up a compiler for you...

Setting up compiler
Java home is <CENSORED>\jre6

Testing compile with Java Compiler (javac)
Java Compiler (javac) does not exists or cannot compile.
Testing compile with Eclipse Compiler for Java (ECJ)
Eclipse Compiler for Java (ECJ) was found and is working.

Compiler has been set up successfully.
Click OK to continue.

I assume I deleted something important when I was deleting robots, that Robocode had to rebuild, or search for and update references, or something else like that.

Anyway, Robocode works for me now (though testing will be a bit harder), so I thank you all for your help.

Sheldor22:23, 26 April 2013
 

Try calling "javac" from the command-line and see if it works.

MN14:48, 27 April 2013

Why? The "Eclipse Compiler for Java" is working fine.

Sheldor20:34, 27 April 2013
 

To track why you still get errors, only that. Eclipse compiler is just as good, if not better, than JDK compiler.

MN12:01, 28 April 2013
 
 

I finally figured it out!

I had been copying the .jar files directly into the robots folder, when I should have been using the Import Downloaded Robot tool. I guess the tool tells Robocode to treat bots differently from just .jar files.

Would this be something of interest to fnl or any of the other Robocode developers?

Sheldor (talk)20:05, 27 May 2013

Nice! If you can reproduce it, I'd definitely report it. I can't imagine it's intentional those two operations would take different code paths. I've only ever copied JARs into the robots directory.

Voidious (talk)20:08, 27 May 2013

Oh, I thought this was some other option to add the robot to the repository/cache, but that's actually just the option for extracting the JAR to source files. So you have to extract every JAR for every robot to not get these errors?

Voidious (talk)20:14, 27 May 2013

I think you are confusing the Import downloaded robot tool with the Extract downloaded robot for editing tool.

Anyway, yeah, it seems I'll have to import each robot individually from now on.

Sheldor (talk)20:24, 27 May 2013

Ahh, you're right of course. I thought those were both options, but I launched Robocode and only saw the one and thought it had just been renamed. But "Extract..." is only offered in the Editor.

Voidious (talk)20:26, 27 May 2013
 
 
 

Is it giving you trouble with the compiler when you just copy in the .jars? Because if so, that is very strange...

I've always just copied the .jars, but then I don't use the built in editor, I use jGrasp.

Skilgannon (talk)20:09, 27 May 2013

Actually, I don't think it has anything to do with the compiler. That was just an early hypothesis I had because every time I compiled, it said it was "Updating classpath: [...]\robots," and it got all the errors.

Sheldor (talk)20:21, 27 May 2013