Difference between revisions of "Robocode/Eclipse/Running from Eclipse"
(Added Category:Eclipse IDE) |
|||
Line 37: | Line 37: | ||
== See Also == | == See Also == | ||
+ | * [[Robocode/Using an IDE|Using Eclipse as IDE]] | ||
+ | * [[Robocode/Eclipse/Create_a_Project|Creating a Project for your Robots]] | ||
+ | * [[Robocode/Eclipse/Create_a_Robot|Creating a Robot in Eclipse]] | ||
+ | * [[Robocode/Add a Robot Project|Adding your Robot Project to Robocode]] | ||
+ | * [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]] | ||
[[Category:Robocode Documentation]] | [[Category:Robocode Documentation]] | ||
[[Category:Eclipse IDE]] | [[Category:Eclipse IDE]] |
Revision as of 22:44, 28 November 2007
This article is a stub. You can help RoboWiki by expanding it. |
Wondering how to run your robot in Robocode from Eclipse? Well this is possible! And that is what this page is all about.
Running your robot from Eclipse
Right-click on your project, move the mouse-pointer down to Run As in the menu that opens and click Run....
http://robocode.sourceforge.net/help/ide/runas.png
Now the following window will show up:
http://robocode.sourceforge.net/help/ide/run.png
Click on the Java Application on the left side, and afterwards the New button (New launch configuration).
Now you should change the name of your launch configuration to something you remember, e.g. MyRobots - Robocode.
In the Main class field you must write robocode.Robocode, which is the main class of Robocode used for playing the game.
http://robocode.sourceforge.net/help/ide/run2.png
Next, you must click on the Arguments tab.
Here you write -Xmx512M -Dsun.io.useCanonCaches=false
into the VM arguments text box. The -Xmx512M
tells the Java VM that Robocode can use up to maximum 512 MB RAM off the heap, and -Dsun.io.useCanonCaches=false
is a workaround to prevent SecurityExceptions to occur when robots try to access a file.
Finally, you must click on the Other radio button under Working directory, and then write the full path to the folder where Robocode is installed in the text file beside Other.
http://robocode.sourceforge.net/help/ide/run3.png
Now you press "Run", and Robocode will (hopefully) start up. In Robocode you start your robot by selecting Battle->New from the menu or by using the hotkey Ctrl+N. Next, you select your robot and some other opponent robots, and press "Start Battle".
The next time you want to run your robot(s) in Robocode from Eclipse, you simply run your launch configuration like this:
http://robocode.sourceforge.net/help/ide/runmyrobots.png
An easier way is just to click on the "green play button" without the popup menu. This will start the last launch configuration automatically, which should be your project.