Java 7, Ubuntu 12.10 64bit issues

At first Maven failed with the following message:

 
Caused by: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-7-oracle/jre/lib/amd64/xawt/libmawt.so: libXrender.so.1: cannot open shared object file: No such file or directory

This was solved by running:

sudo apt-get install libxrender-dev
 
Caused by: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-7-oracle/jre/lib/amd64/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory

So I had to install some other stuff:

sudo apt-get install libxtst-dev