I'm developing a library in Java and need to use it in Matlab. Both Java and Matlab codes are under constant development; therefore whenever I rebuild the Java code and create a new jar file, I need to reload it in the Matlab code and use the fresh jar file there. My problem is that Matlab locks the jar file and I cannot replace the old jar file with the new one, unless I restart the whole Matlab environment. How can I make Matlab unlock my jar file?
I access the Java classes and methods through
javaaddpath('path/to/jar/file.jar');
Also in the end I call:
javarmpath('path/to/jar/file.jar');
but it does not unlock the file either. I use Matlab 7.9.0 (R2009b).