Yes, it is possible to run java code from MATLAB environment. Kindly go through the following link
To control/debug you program inside matlab go through this link
Hope this helps.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!