Thread Subject: Cannot Delete .jar File Used in Matlab

Subject: Cannot Delete .jar File Used in Matlab

From: JoeyB

Date: 9 Oct, 2009 16:12:15

Message: 1 of 2

Hi All,

I've got a java swing based classes in a .jar file that I'm using in
my .m code. - data grid.
That works fine.
Sometimes, I need to go back and re-compile the .jar (in Netbeans).
When I do this,
Netbeans is not allowed to delete the old .jar because Matlab is
holding on to it.
I've tried all combinations of 'clear all', 'clear java' removing the
folder from the javaclasspath
No references to the folder in the normal path. No figures open that
referenced the swing object.
The only way I can get Matlab to release the .jar file is to close
Matlab. Thats a HUGE PIA when
making changes to the java code as ML takes about a minute to come
up.

Please, someone give me the 'secret' to truly releasing java classes
in ML? Thanks.

Subject: Cannot Delete .jar File Used in Matlab

From: justin

Date: 24 Nov, 2009 07:29:04

Message: 2 of 2

hi, i have the same setup for my current project and got the same
problem, and google found ur post. seems like no one knows the
solution.

i have a work around, i just point my javaclasspath in matlab to the
build directory of my netbeans project.

with the default settings in NB, .class files are compiled on file
save. and matlab magically picks up the difference w/o locking the
file.

on a deeper level, i'm guessing this has something to do w/ the
dynamic class loader, loading the .class file on every execution, vs.
loading jar file, once and hence locking it.



On Oct 9, 8:12 am, JoeyB <joseph.bur...@gm.com> wrote:
> Hi All,
>
> I've got a java  swing based  classes in a .jar file that I'm using in
> my .m code. - data grid.
> That works fine.
> Sometimes, I need to go back and re-compile the .jar (in Netbeans).
> When I do this,
> Netbeans is not allowed to delete the old .jar because Matlab is
> holding on to it.
> I've tried all combinations of 'clear all', 'clear java' removing the
> folder from the javaclasspath
> No references to the folder in the normal path. No figures open that
> referenced the swing object.
> The only way I can get Matlab to release the .jar file is to close
> Matlab. Thats a HUGE PIA when
> making changes to the java code as ML takes about a minute to come
> up.
>
> Please, someone give me the 'secret' to truly releasing java classes
> in ML?    Thanks.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com