[Home]Eclipse/Setup

Robo Home | Eclipse | Changes | Preferences | AllPages

Here is a quick get-on-your feet with Robocode setup.

Starting Assumption:

  1. Eclipse is installed.
  2. Robocode is installed in c:\robocode.
  3. Your bot is named police.Robocop.
  4. Your source code is in f:\source. (main class file is thus f:\source\police\Robocop.java)

Steps:

  1. Start Eclipse.
  2. When prompted for the workspace, use 'c:\workspaces\Robocode Workspace' or some preferred path.
  3. Close the introductory window.
  4. Select menu option File | New | Project
  5. Ensure Java Project is highlighted and click Next.
  6. Choose a project name, such as 'Robocode Project' or 'Robocop'. You may want other projects later for other bots or to isolate testing, etc.
  7. Click Next.
  8. On the 'Source' tab, in the upper right there is an icon with a tooltip that reads 'Link Additional Source to Project'. Click it.
  9. Browse to f:\source. Click OK.
  10. Leave the folder name as is or rename it, as you prefer. It will appear as an expandable entry under the project name, and your packages (e.g. police) will we expandable entries under it.
  11. Click OK.
  12. With your source file name highlighted on the 'Source' tab window, find the 'Default Output Folder:' section at the bottom and click 'Browse'.
  13. Click 'Create New Folder'. Click 'Advanced' Checkmark the 'Link to a folder in the file sytetm' option. Click 'Browse'.
  14. Navigate to c:\robocode\robots. Click OK.
  15. Enter a name in the 'Folder Name:' field, such as 'output'. Click OK. Click OK.
  16. Select the 'Libraries' tab.
  17. Click 'Add External JAR's...'.
  18. Navigate to c:\robocode. Select 'robocode.jar'. Click 'Open'.
  19. Click Finish.
  20. Select menu option Project | Build Automatically (if it isn't already checkmarked).

You are ready to go.

This example follows my setup where I have Robocode installed at both home and work on different drive letters, workspaces and projects at home and work, and the source code on a 256 meg USB drive. I tried putting everything on the USB drive but the speed of Robocode extracting robots and rebuilding its database was inadequate. The drive letters are different for my USB drive and Robocode istallation at home and work, so this setup is the only way to address my situation.

With this setup your code will be compiled right into Robocode's robot directory every time you save a file. The next battle you start will use the latest code. If you add a new robot class while Robocode is running you will need to refresh Robocode's robot listing, as usual. (Same goes for dropping in other folk's jar files on the fly.)

You may be able to figgure out how to build JAR files on the fly, but I just use Robocode's built-in feature for that, and I don't have to worry about including source by mistake because the source code never makes it to Robocode's robots directory .. only the compiled class files.

-- Martin Alan Pedersen / Ugluk



Robo Home | Eclipse | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited January 24, 2006 22:23 EST by Martin Alan Pedersen (diff)
Search: