Why am I unable to delete or overwrite Java Archive Files (JARs) after using JAVARMPATH to remove them from the Java classpath in MATLAB 7.3 (R2006b)?
조회 수: 2 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2009년 8월 25일
댓글: Walter Roberson
2022년 2월 27일
I am doing joint MATLAB & Java development, and often I need to recompile a Java class and recreate the JAR file that MATLAB is using to access the Java classes.
I have found that even after I call JAVARMPATH I cannot overwrite or delete the JAR file in Windows; I receive the following error message:
Cannot delete foobar.jar: It is being used by another person or program.
I expected to be able to overwrite a JAR file with the new version, but was unable to do so because the JAR file was still "being accessed" by MATLAB.
채택된 답변
MathWorks Support Team
2009년 8월 25일
The ability to explicity unload Java classes is not available in MATLAB.
MATLAB uses Java's class-loader features to the extent possible to reload new class definitions, while the Java Virtual Machine (JVM) controls when classes get unloaded, and hence whether or not JAR files are released.
If the objects associated with the JAR files are no longer in use, see the Related Solution listed below about forcing Java garbage collection.
댓글 수: 1
Walter Roberson
2022년 2월 27일
Some discussion of the internal java technology required:
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!