It looks like a class error. Based on your editing, it looks like you are using Eclipse. When you right-click on the project, select Build Path > Configure Build Path... , and then go to the Libraries tab (or Order and Export), you will see mpj.jar . I assume that he will not be there, and you will need to add it.
This is not the same as mpi.jar you were talking about. I just created a simple test project using the code you provided and mpj.jar (downloaded from here ), and everything works.
source share