that were shone when I got tempered!

Static analysis with HammurAPI

leave a comment »

Install the HammurAPI.



  • Then go to the path that hammurapi-5.7.0-setup.jar is downloaded.
  • Install hammmurapi using this command in the terminal.
    • java -jar hammurapi-5.7.0-setup.jar
  • Then this will install hammerapi in your home folder. This contains DB (HSQLDB) and Tomcat also in the same package (eg : /home/namal/Hammurapi)

Start the DB (HSQLDB)

  • Go to the /home/namal/Hammurapi/db.
  • Give the excecution permission to runServer.bat.
  • Run it. (I double clicked and selected to “Run In the Terminal”).
    • The default port for the db is 9001. If the port is already bound, kill it after identifying the process ids using the netstat commands as mentioned below and run the runServer.bat again.
      • netstat –listen – You’ll get all the port numbers currently using
      • netstat -lpn | grep 9001 – You’ll get the process with process id that is using the port 9001
      • sudo kill 4758 : kill it

Start the Tomcat

  • Go to the /home/namal/Hammurapi/tomcat/bin
  • Give the excecution permission to ./
  • Run it as ./
  • If not executing run chmod +x *.sh first and then run it ./ again.
  • Test it with the http://localhost:8080

Install the ant to your system


  • Download the archive using the mentioned link.
  • Extract it to some directory. (In my case I copied it to the project folder that I’m willing to test)

Test the provided sample project.

There’s a sample project in the Hammurapi. We can test it first to verify that everything is OK behind the scene.

  • Go to the /home/namal/Hammurapi/sample
  • Run the following tasks on build.xml
    • apache-ant-1.9.3/bin/ant
    • apache-ant-1.9.3/bin/ant review
    • apache-ant-1.9.3/bin/ant wget
      • Here the report will be extracted into the /home/namal/Hammurapi/report folder
      • In this case provide the as a VM argument as mentioned above.

Test the project.

  • Take the project to the /home/namal/Hammurapi folder.
  • Put all the related jars refering from it in the lib folder.
  • Copy the build.xml to that folder.
  • Follow above tasks mentioned in the sample project



Written by Namal Fernando

May 1, 2014 at 7:49 am

Posted in HammurAPI, Static Analysis

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Ruth's Reflections

Contemplations from quakey quirky Christchurch

TED Blog

The TED Blog shares interesting news about TED, TED Talks video, the TED Prize and more.


Learn and discover simple things

Meihta Dwiguna Saputra's Knowledge Base

~In learning you will teach and in teaching you will (re)learn~

The Java Blog

Thoughts, tips and tricks about the Java programming language


that were shone when I got tempered!

%d bloggers like this: