Skip to content
David Bürgin edited this page Nov 1, 2015 · 38 revisions

Setup

Let's set things up and get started. I'm assuming you have the following ready.

  • Java 1.8
  • Maven
  • a Unix-like environment -- though give or take some minor adjustments this tutorial should work on Windows, too

Get the code

From this repo.

git clone ...

Now is a good time to check if we're starting out all green. Run the install Maven goal to compile, test, and install the web app locally. Then start the web server

mvn install
mvn tomcat7:run

You should see the 'BUILD SUCCESS' message at some point. Then go to http://localhost:9966/petclinic/ and browse around to get familiar with the app.

This is the Pet clinic.

Hit Control-C to stop the web server, and turn the page for [next chapter].

Install the Checker Framework

Local installation in /opt.

Maven

We're going to do this slightly differently from the suggested installation at Checker Framework: compilation with checking is going to be separate from compilation for production.

The class files produced by the Checker Framework's compiler with annotation processing is different from the class files output by the standard compiler. Annotation processors already used in a project's build process may interfere with the Checker Framework's annotation processors: this is the case with the petclinic, which already uses annotation processing in the persistence layer -- I did not manage to run the code produced by the Checker Framework compiler.

Apart from that, it goes without saying that in many professional Java environments compiling with a different compiler is not an option. And if you're trying to convince your colleagues to get into checking, making it optional might actually be a boon.

Clone this wiki locally