Discussion:
Using NetBeans
Ed
2010-06-07 16:40:02 UTC
Permalink
Greetings all,

I am trying to develop a robot using NetBeans. I have two questions:

--Is it possible to run robocode from within NetBeans? If so, how is it done? I want to be able to do this so I can debug my robot. I see instructions for running and debugging robots with Eclipse, but I am hoping to avoid learning yet another IDE.

--(really more of an annoyance) I changed the name of my robot by changing the name of the class and file in NetBeans. Now both the old (no longer valid) and new names appear in the list of available robots to start a battle. Ctlr-R doesn't seem to do anything. How do I remove the old name?

Thanks in advance,
Ed





------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2010-06-07 20:05:43 UTC
Permalink
Hi Ed,

Thanks for reminding me of writing an article on the RoboWiki for how to use NetBeans for developing robots on Robocode. I will write such an article in the near future, and write back to you here, when it is finished. It sure is possible and easy to use NetBeans or any other IDE for developing robots in Robocode. Robocode supports "development paths" to external IDEs, which you set up from the menu: Options -> Preferences -> Development Options. Here you add the root to where your robot class files are located (actually, the folder to where your initials is located).

Regarding your second question. If Robocode still lists your old robot, it can see the old robot .class file somewhere, and you need to delete it. You might also have a .properties file, which specifies the name of the old robot. Try to do a file search on your folders with the name of the old robot in order to find it (inside the files, not just the filename).

Regards,
- Flemming
Post by Ed
Greetings all,
--Is it possible to run robocode from within NetBeans? If so, how is it done? I want to be able to do this so I can debug my robot. I see instructions for running and debugging robots with Eclipse, but I am hoping to avoid learning yet another IDE.
--(really more of an annoyance) I changed the name of my robot by changing the name of the class and file in NetBeans. Now both the old (no longer valid) and new names appear in the list of available robots to start a battle. Ctlr-R doesn't seem to do anything. How do I remove the old name?
Thanks in advance,
Ed
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Ed
2010-06-08 20:47:17 UTC
Permalink
Flemming,

Your answer to my second question was right on. Although the .java file for my old robot was gone, the .class file wasn't. I deleted the .class file and problem solved.

The robowiki article on netbeans explains clearly how to write robots using netbeans. What I want to know is how to *run* robocode in netbeans so that I can debug my robot. I haven't been able to figure this out.

Ed
Post by flemmingnlarsen
Hi Ed,
Thanks for reminding me of writing an article on the RoboWiki for how to use NetBeans for developing robots on Robocode. I will write such an article in the near future, and write back to you here, when it is finished. It sure is possible and easy to use NetBeans or any other IDE for developing robots in Robocode. Robocode supports "development paths" to external IDEs, which you set up from the menu: Options -> Preferences -> Development Options. Here you add the root to where your robot class files are located (actually, the folder to where your initials is located).
Regarding your second question. If Robocode still lists your old robot, it can see the old robot .class file somewhere, and you need to delete it. You might also have a .properties file, which specifies the name of the old robot. Try to do a file search on your folders with the name of the old robot in order to find it (inside the files, not just the filename).
Regards,
- Flemming
Post by Ed
Greetings all,
--Is it possible to run robocode from within NetBeans? If so, how is it done? I want to be able to do this so I can debug my robot. I see instructions for running and debugging robots with Eclipse, but I am hoping to avoid learning yet another IDE.
--(really more of an annoyance) I changed the name of my robot by changing the name of the class and file in NetBeans. Now both the old (no longer valid) and new names appear in the list of available robots to start a battle. Ctlr-R doesn't seem to do anything. How do I remove the old name?
Thanks in advance,
Ed
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2010-06-09 20:11:06 UTC
Permalink
Hi Ed,

I am happy that the problem was solved regarding the appearance of the old robot.

Regarding how to debug in NetBeans, I suggest that you write this question on the page for the article on the RoboWiki, and ask the author to write about this as well:

http://robowiki.net/wiki/Talk:Robocode/NetBeans/Configure

Hopefully, the author will follow up on this. If not, you are welcome to write again, and I will follow up on this later.

Regards,
- Flemming
Post by Ed
Flemming,
Your answer to my second question was right on. Although the .java file for my old robot was gone, the .class file wasn't. I deleted the .class file and problem solved.
The robowiki article on netbeans explains clearly how to write robots using netbeans. What I want to know is how to *run* robocode in netbeans so that I can debug my robot. I haven't been able to figure this out.
Ed
Post by flemmingnlarsen
Hi Ed,
Thanks for reminding me of writing an article on the RoboWiki for how to use NetBeans for developing robots on Robocode. I will write such an article in the near future, and write back to you here, when it is finished. It sure is possible and easy to use NetBeans or any other IDE for developing robots in Robocode. Robocode supports "development paths" to external IDEs, which you set up from the menu: Options -> Preferences -> Development Options. Here you add the root to where your robot class files are located (actually, the folder to where your initials is located).
Regarding your second question. If Robocode still lists your old robot, it can see the old robot .class file somewhere, and you need to delete it. You might also have a .properties file, which specifies the name of the old robot. Try to do a file search on your folders with the name of the old robot in order to find it (inside the files, not just the filename).
Regards,
- Flemming
Post by Ed
Greetings all,
--Is it possible to run robocode from within NetBeans? If so, how is it done? I want to be able to do this so I can debug my robot. I see instructions for running and debugging robots with Eclipse, but I am hoping to avoid learning yet another IDE.
--(really more of an annoyance) I changed the name of my robot by changing the name of the class and file in NetBeans. Now both the old (no longer valid) and new names appear in the list of available robots to start a battle. Ctlr-R doesn't seem to do anything. How do I remove the old name?
Thanks in advance,
Ed
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2010-06-07 21:29:28 UTC
Permalink
It turns out that somebody else has already provided an article on the RoboWiki for how to setup NetBeans for Robocode. You can read about it here:

http://robowiki.net/wiki/Robocode/NetBeans/Configure

If you miss something with this article, please write about it on the "Discussion" page for it here:

http://robowiki.net/wiki/Talk:Robocode/NetBeans/Configure

Regards,
- Flemming
Post by Ed
Greetings all,
--Is it possible to run robocode from within NetBeans? If so, how is it done? I want to be able to do this so I can debug my robot. I see instructions for running and debugging robots with Eclipse, but I am hoping to avoid learning yet another IDE.
--(really more of an annoyance) I changed the name of my robot by changing the name of the class and file in NetBeans. Now both the old (no longer valid) and new names appear in the list of available robots to start a battle. Ctlr-R doesn't seem to do anything. How do I remove the old name?
Thanks in advance,
Ed
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2010-06-10 21:15:33 UTC
Permalink
Hi Ed,
I still haven't forgot your question about how to debug a robot within
NetBeans. So here I give you the description. [:)]
Run/debug Robocode from NetBeansFirst of all, you need to add a
development path that points to your robots classes in your NetBeans
project.In Robocode, select this from the menu: Options -> Preferences
->Development Options.Press the Add button to browse to your development
path in NetBeans. It could be something like this:
R:\NetBeansProjects\MyRobots\build\classes
Note, that you should point at the 'classes' folder to get it right.
Secondly, you need to set your project configuration regarding running
your robot. You do this within your project in NetBeans from the menu:
Run -> Set Project Configuration ->Customize...Under the Run category,
you first create a new configuration, which you could name Robocode.Next
you field out the following fields and values:
Main Class: RobocodeWorking Directory: C:\robocodeVM Options: -Xmx512M
-Dsun.io.useCanonCaches=false -Ddebug=true
Note: It is very important to set Robocode to run your robots in debug
mode. In this mode your robot is allowed to use lots of time between
rounds, while debug your robots. Otherwise your robot will be stopped
almost immediately with an error telling you that your robot skipped too
many turns. The debug mode is set with the 'VM Options' above.
Note, your working directory should point to where you have installed
Robocode.The VM options must refelect the options specified in the
robocode.bat, robocode.sh and robocode.cmd file (they are set to the
same options in all these startup scripts).
Now you can press Ctrl + F5 or select Debug -> Run Main Project from the
menu, and Robocode will start up.
Create a battle fileYou need to start up a new battle, and here your
robot(s) should show up, if you have added the development path into
where your robot(s) reside in the NetBeans project.
If (or rather when) you get tired of starting a new battle all the time,
then create a new battle with the opponent robots and battle field
configuration you need, and save the battle, e.g. with the name
test.battle.
Next, you return to the project configuration (menu: Debug -> Set
Project Configuration ->Customize... under the Run configuration), and
set this additional parameter:
Arguments: -battle test.battle
This will tell Robocode to start up with your battle automatically.
You can now set breakpoints in your robot, and start debugging your
robot.
Important!When you are debugging your robots, the battle will continue
in the speed specified by your TPS slider in the bottom of your battle
screen. This is annoying, as the battle will probably end before you
reach the breakpoints you set in the NetBeans within your source file.
Hence, you need to active the Pause/Debug mode of Robocode, which is the
button named 'Pause/Debug' in the bottom left corner of the battle view.
Whenever you need to step to the next turn in the game, you must press
the 'Next Turn' button beside the 'Pause/Debug' button. Take a look at
the title bar, which displays the current turn. You should see that it
is incremented by one turn each time you press the button. [;)]
I hope this helps?
Post by Ed
Greetings all,
--Is it possible to run robocode from within NetBeans? If so, how is
it done? I want to be able to do this so I can debug my robot. I see
instructions for running and debugging robots with Eclipse, but I am
hoping to avoid learning yet another IDE.
Post by Ed
--(really more of an annoyance) I changed the name of my robot by
changing the name of the class and file in NetBeans. Now both the old
(no longer valid) and new names appear in the list of available robots
to start a battle. Ctlr-R doesn't seem to do anything. How do I remove
the old name?
Post by Ed
Thanks in advance,
Ed
Loading...