How to use NetBeans for COMP 2402

  1. Download and install the latest version of NetBeans. For this course, the basic Java SE version is perfect.
  2. Run NetBeans and create a new Java project.
    • Click the New Project button.
    • Then
    • Select 'Java' and 'Java Application'.
  3. Call it "Assignment1" and place it in the folder you use for the course.
    • Project Name: Assignment1. Project Location: comp2402.
  4. Do not create a main class. We will use the ones in the assignment source.
    • Uncheck 'Create Main Class'.
    • Then
    • Click 'Finish'.
  5. Download the source code for the assignment and extract it to Assignment1/src.
    • The result should be a folder 'comp2402a1' in 'Assignment1/src'.
    • The folder 'Assignment1/src/comp2402a1' should contain 'Part0.java' through 'Part8.java'.
  6. The new files should automatically appear in NetBeans.
    • In the projects tab on the left, expand 'Assignment1', 'source packages', and 'comp2402a1'. The source files from the assignment should be listed there.
  7. Create a test file called test.txt and place it in the Assignment1 directory.
    • The 'Assignment1' directory should now contain (at least) the folders 'nbproject' and 'src', along with the files 'build.xml', 'manifest.mf' and 'test.txt'.
  8. In the toolbar, expand the drop-down menu that says "<default config>" and choose "Customize...".
    • The dropdown menu is between the 'redo' and 'build' buttons.
  9. Change the main class to the class you want to run (we'll pick Part0 here) and enter test.txt for the argument.
    • Main Class: 'comp2402a1.Part0'. Arguments: 'test.txt'.
  10. Run the project (from the toolbar or by pressing F6). The output should appear.
    • Click the 'Run Project' button.
    • Then
    • The Output tab should appear at the bottom of the screen, containing (approximately) the following text: <the lines from your input file in arbitrary order> Execution time: 0.00 BUILD SUCCESSFUL (total time: 0 seconds).
  11. You're good to go!