JMU JMU - Department of Computer Science
Help Tools
Installing and Configuring a Java Development Environment


1 Something to Keep in Mind

It is a bad idea to use spaces in file names and/or directory names since whitespace is often used as a delimiter. This includes directories with names like My Documents and John Smith.

2 Before Starting

Before you start to install the Java Development Environment you may want to do the following:

Regardless of whether or not you create such a user account:

3 Installing the Java Development Tools

The first step in the process is to install the basic components.
  1. Install the Java Development Kit Standard Edition v21.
    You may use either the Oracle JDK (available from Oracle.com) or the OpenJDK (available from Adoptium.net or java.net).
    You may install a more recent version but your code must not use features beyond those in v21 and you must cross-compile your code so that the .class files are consistent with v21. (See the CS Wiki for help.)
  2. Install Eclipse v2024-06
    You may either install it for the first time or, if you have an earlier version installed, upgrade your existing installation.
  3. Select an Eclipse Workspace.
    Start Eclipse. Then, when asked to select a workspace, browse to the eclipse directory/folder you created for this course (e.g., /home/bernstdh/cs300/eclipse). For help, see the Departmental Wiki on Eclipse workspaces.
  4. Ensure that the Checkstyle Plugin was Installed.
    Click on Help+About Eclipse IDE+Installation Details, select the "Installed Software" tab, and search the list for something like "Eclipse Checkstyle Plugin". If it hasn't been installed, install the Eclipse Checkstyle plugin.
  5. Download (using a right-click in most browsers) the course formatter for Eclipse and save it in an appropriate location (e.g., /home/bernstdh/cs300/downloads).
  6. Download (using a right-click in most browsers) the course Checkstyle configuration/checks file and save it in an appropriate location (e.g., /home/bernstdh/cs300/downloads).
  7. Follow the instructions on the Department Wiki to configure the Eclipse workspace to use the course formatter. (You will use the same formatter for every assignment. If you configure the workspace to use the formatter, you will not have to configure each project individually.)
  8. Follow the instructions on the Department wiki to configure the Eclipse workspace to use the course Checkstyle configuration/checks file. (You will use the same style guide for every assignment. If you configure the workspace to use the checks file, you will not have to configure each project individually.)
  9. Click on Help+About Eclipse IDE+Installation Details, select the "Installed Software" tab, and search the list for something like "EclEmma Java Code Coverage". If it hasn't been installed, follow the instructions on the Department wiki to install EclEmma.
  10. Check to see if the JUnit plug-in for Eclipse was installed by looking under File-New for JUnit Test Case. If it is not installed, you can install it from the Help menu in Eclipse.

Note that the course formatter does not satisfy all of the specifications in the course style guide. You may be able to modify the formatter to make it more compliant but some of the specifications must be dealt with manually.

4 Creating Projects

Each time you create a Java project in Eclipse, you must:

Copyright 2024