Run the automatic lab grader

1.    Copy the following files to the root of your class folder, e.g., P:\cs256:



2.    Double click ag.jar to run the autograder.


The autograder is incompatible with Java 1.9.   If you have java JDK 1.9 installed and run the autograder, when the autograder attempts to compile, the compiler gives a NullPointerException.

You can work around this problem by installing the Java 1.8 JDK:

·       Visit


Java SE Development Kit 8u…

·       Click Accept License Agreement radio button

·       In the Download column, choose the appropriate version for your system

·       Double click the downloaded file to install the 1.8 JDK


Restart the autograder.

The autograder is a program that uses a test harness to test your java lab. The autograder executes the following steps:

  1. Download the test harness program to your computer.
  2. Compile the test harness and your lab code.
  3. Execute the test harness, which calls your code and tests it.
  4. Gather the results and calculate a grade for your lab.
  5. Send the results back to the server.

To run the autograder, you need to supply both of the following:

You will also be asked for:

Your userID is the same ID you use to log into the SOU network.

You supply all information after you click to run the autograder.



Write all other outputs, including input prompts for the user to:


in the parameter you pass to println(). The autograder does not handle it correctly.


It kills your program and the autograder as well, so the autograder is unable to report your results to the server.

·        If your program is required to read input from the user:

You must declare your Scanner variable in class level scope (outside of any method) as follows:

   private static Scanner scan = new Scanner(;


The autograder will throwing a NoSuchElement exception if you declare use a local variable to hold a reference to your Scanner object.



Running the autograder on a mac:

From Noah Soule (thanks, Noah):

Mac os10 has had it's security defaults changed so it no longer works to double click on the icon of ag.jar. 


First follow these instructions to change gatekeeper's preferences to allow apps from unidentified developers:


Then option click, right click, or two finger click (depending on how you have your mac set up) on the fresh copy of ag.jar you just downloaded from


after option clicking on ag.jar select "open with" and select Jar.Launcher (default).


Ignore the warning and click "Open Anyway."


From Andrew Krug (thanks, Andrew):

The file tools.jar is called classes.jar on macs.  It can be found in a directory similar to /System/Library/Frameworks/JavaVM.framework/Versions/1.8.0/Classes/classes.jar file.


Drag classes.jar onto the desktop. This will make a copy.  Rename classes.jar to tools.jar.


Drag tools.jar back into /System/Library/Frameworks/JavaVM.framework/Versions/1.8.0/Classes/


A message box will pop up that states. "This folder cannot be modified." There will be two buttons.  "Okay" and Authenticate.  Select the Authenticate option.  Authenticate with your admin user name and password and it will copy your new tools.jar file into the Classes directory.


Run the autograder. 


Point the autograder at your files using the Unix path system.  If you are just using your Home Directory the path will look something like /Users/YourName/Documents/CS257 (Hint: Remember Unix is case sensitive)


Point to the new tools.jar file you just created by pasting in /System/Library/Frameworks/JavaVM.framework/Versions/1.8.0/Classes/ you have the option to leave off tools.jar or append it.  The autograder will automatically look for tools.jar in whatever director you point it at. 


Run the autograder like normal.


Notes on other issues. 


Best of luck to you. Please contact Pete Nordquist with questions or comments about the autograder. If you get exceptions that you do not understand, please copy the entire output log into an email message and send it to me. Thank you.

The autograder is licensed under the GNU GPL.
Click here for source code (in zip format) for the autograder.
Click here for a sample test harness.