Difference between revisions of "Robocode/Eclipse/Create a Project"
(Updated links to other pages) |
|||
(6 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Youtube|3qOoDuGkwco|Creating an Eclipse Robocode Project}} | ||
+ | |||
In order to build a [[Robocode]] robot in [http://www.eclipse.org/ Eclipse], we first have to create a '''Project''' to store them in. This page will assist you in setting that up. | In order to build a [[Robocode]] robot in [http://www.eclipse.org/ Eclipse], we first have to create a '''Project''' to store them in. This page will assist you in setting that up. | ||
Line 12: | Line 14: | ||
− | Type in a name for your project. | + | Type in a name for your project. A project can contain just one robot or many robots, so choose a name to suit your plans. Here we use the name '''MyRobots''' as the name for the new project. When you have written the name of the new project then click '''Next'''. <span style="color:red">''But do not click '''Finish''' yet!''</span> |
[[Image:Eclipse-NewJavaProject.png|Shows a dialog for creating a new Java project where the user must type in a name for the new project]] | [[Image:Eclipse-NewJavaProject.png|Shows a dialog for creating a new Java project where the user must type in a name for the new project]] | ||
Line 19: | Line 21: | ||
=== Oops! I clicked '''Finish'''. What to do? === | === Oops! I clicked '''Finish'''. What to do? === | ||
If you clicked '''Finish''' by mistake, you can find the rest of the screens shown by right-clicking on the project named '''MyRobots''', then select '''Properties''', and then select '''Java Build Path'''. | If you clicked '''Finish''' by mistake, you can find the rest of the screens shown by right-clicking on the project named '''MyRobots''', then select '''Properties''', and then select '''Java Build Path'''. | ||
− | |||
== New Project == | == New Project == | ||
Line 50: | Line 51: | ||
Congratulations! Your new project is ready. :-) | Congratulations! Your new project is ready. :-) | ||
+ | |||
+ | == Note about module-info.java == | ||
+ | Please note that the newest versions of Eclipse will ask if you want to create a module-info.java file. | ||
+ | If you get this question, you should select "Don't create". | ||
+ | |||
+ | '''If you by mistake create a module-info.java, then you should make sure to delete it to avoid compiler and classpath issues.''' The module-info.java is not used for Robocode packages. | ||
== References == | == References == | ||
Line 57: | Line 64: | ||
== See also == | == See also == | ||
+ | |||
+ | === Using Eclipse IDE === | ||
+ | * [[Robocode/Eclipse|Using Eclipse as IDE]] | ||
+ | * [[Robocode/Add_a_Robot_Project|Add robot project from an IDE into Robocode]] | ||
+ | * [[Robocode/Eclipse/Create_a_Robot|Creating a robot in Eclipse]] | ||
+ | * [[Robocode/Running from Eclipse|Running your robot from Eclipse]] | ||
+ | * [[Robocode/Eclipse/Debugging Robot|Debugging your robot with Eclipse]] | ||
=== Robot API === | === Robot API === | ||
Line 77: | Line 91: | ||
* [[Robocode/Console Usage|Starting Robocode from the command line]] | * [[Robocode/Console Usage|Starting Robocode from the command line]] | ||
* [[Robocode/Graphical_Debugging|Graphical debugging]] | * [[Robocode/Graphical_Debugging|Graphical debugging]] | ||
− | |||
− | |||
− | |||
− | |||
=== News and Releases === | === News and Releases === |
Latest revision as of 20:37, 29 May 2019
In order to build a Robocode robot in Eclipse, we first have to create a Project to store them in. This page will assist you in setting that up.
Contents
Creating a Project for your Robots
First, select File->New->Project in the menu.
In the New Project dialog, select Java Project then click Next.
Type in a name for your project. A project can contain just one robot or many robots, so choose a name to suit your plans. Here we use the name MyRobots as the name for the new project. When you have written the name of the new project then click Next. But do not click Finish yet!
Oops! I clicked Finish. What to do?
If you clicked Finish by mistake, you can find the rest of the screens shown by right-clicking on the project named MyRobots, then select Properties, and then select Java Build Path.
New Project
Select the Libraries tab, then click on Add External JARs:
Browse to the robocode directory, select the libs directory and then click the Open.
Next, select the robocode.jar and then click the Open.
Now you must select the Javadoc location: (None) under robocode.jar and click Edit...
Type in (or browse to) the path for robocode.jar again. Optionally, enter the location of Robocode's Javadocs. The window should now look like this:
Click OK, then click Finish to build your project.
Congratulations! Your new project is ready. :-)
Note about module-info.java
Please note that the newest versions of Eclipse will ask if you want to create a module-info.java file. If you get this question, you should select "Don't create".
If you by mistake create a module-info.java, then you should make sure to delete it to avoid compiler and classpath issues. The module-info.java is not used for Robocode packages.
References
See also
Using Eclipse IDE
- Using Eclipse as IDE
- Add robot project from an IDE into Robocode
- Creating a robot in Eclipse
- Running your robot from Eclipse
- Debugging your robot with Eclipse
Robot API
Tutorials
- System Requirements for Robocode
- How to download and install Robocode
- The anatomy of a robot
- Getting started with Robocode
- My First Robot Tutorial
- Robocode Game Physics
- Scoring in Robocode
- Using the robot console
- Downloading other robots
- Learning from other robots
- Package your robot
- Frequently Asked Questions (FAQ)
- Articles about Robocode
- Starting Robocode from the command line
- Graphical debugging