Optional Notes — Setting the Environment
- Setting code comments
- Checking compiler compliance level
- Selecting Java Runtime Environment
Required Code Comments
This course requires a formatted comment at the beginning of every Java class submitted. The format for this comment can be found on the course coding standards page. In Eclipse, templates for comments and coding styles can be set. With a template set, Eclipse will automatically create an empty opening comment for us.
We will define a template for the opening comment.
- Navigate to “Window → Preferences → Java → Code Style → Code Templates → Comments → Files”.
- Click edit, and in the ‘Pattern’ box, type what you see in the image above, filling in your name, email, and section.
- You will need to fill in the rest of this information by hand for every Java file you create.
Checking compiler compliance level
Select JDK Compiler compliance level as 1.6 so that it follows J2SE 1.6 standards for compiling Java programs for the project. To set the compiler compliance level, go to “Window → Preferences → Java → Compiler”. In the JDK Compliance section, select the compiler compliance level to 1.6.
Selecting Java Runtime Environment
While selecting compiler compliance, make sure you have a compatible JRE (Java Runtime Environment) installed and activated. To do so, go to “Window → Preferences → Java → Installed JRE” and select the checkbox against the appropriate JRE. For those using their laptops, they should add the installed JRE and then select it.