MentaAffinity uses JNA to make native calls, so make sure you have it installed on your system. For Ubuntu you usually just have to do:
sudo apt-get install libjna-java
yum install jna
IMPORTANT: You will probably have to add the JNA jar in your classpath. Run your application with -DlogLevel=debug to see if JNA is being loaded by your JVM. If not download the JNA jar and include it in your classpath. Go to the JNA website to get the latest jar or download the latest tested version here.