...
- Close Eclipse.
- Navigate to the checked-out folder (usually the name of the branch) and open the .project file in a text editor. Note that the file may be hidden on your system.
- Change
toCode Block <natures></natures>
Code Block <natures><nature>org.eclipse.jdt.core.javanature</nature></natures>
- Save and close the .project file
- Re-open Eclipse.
4. Set up the Eclipse build path
You'll want Eclipse to be able to find and build all your code so that you can use Autocomplete, edit-time code checking, and debugging. This requires some setup.
- In the Package Explorer, right-click on your project and choose Properties.
- Go to Java Build Path.
- On the Source tab, remove any existing entries, and click Add Folder.
- Select the
agents
,gameconfigs
,gui
, andsrc
folders. Depending on your project, you might have additional folders that contain Java code; you should add those here. - On the Libraries tab, click Add JARs
- Navigate to the
lib/jars
folder and choose all of the JAR files that it contains.
- Click OK.
- Eclipse should now reorganize the package hierarchy in the Package Explorer.
5. Access Ant from Eclipse
You can load CT's build.xml into Eclipse, making it possible to run Ant targets without opening up a command line.
- In Eclipse, choose Window > Show View > Ant
- In the new empty Ant pane that appears, click on the leftmost icon (a + next to a small ant) to add a build file.
- In the list that pops up, expand the CT3 folder and select build.xml.
- You'll now see an entry labeled
coloredtrails
in the Ant pane. Click the + or arrow next to it to expand it. - You can now double-click any of the targets to run them.