cd generated_src, i.e., compile all the Java classes in example/swig/generated_src:
javac -source 1.3 -target 1.3 *.java
Next, copy the *.class files in two directories as follows. LoadYarp.class and YarpImageHelper.class go to (say) ~/jyarp; all the remaining files go to ~/jyarp/yarp. (This is because the latter files have to be in a directory called "yarp", like the corresponding Java package.) Add ~/jyarp to MATLAB's classpath.txt file (read below for further information about this).
Add these lines to the end of Matlab's Classpath.txt (run which classpath.txt in Matlab, e.g., /usr/local/MATLAB/R2012a/toolbox/local/classpath.txt):