Java exception occurred:
java.lang.OutOfMemoryError: PermGen space
So I did a little of the Internet browsing and I found out that the solution to that problem was to create file java.opts in my working directory. In this file, one can put all options to java virtual machine. To increase my memory amount i had to put there:
-Xms128m
-Xmx128m
-XX:PermSize=128m
-XX:MaxPermSize=128m
Only with that option, my Matlab 7.0 and my java program worked. I also tried solution at official matlab site: here. But it didn't work. I had to use all four parameters in order to run my program.