MATLAB: Clash with existing Jar files

java interaction

I am using Matlab R2011a The following code works because the ImmutableList of Google is contained in some jar file listed in JavaClasspath
>> import com.google.common.collect.ImmutableList;
>> w = ImmutableList.of('Hans','Wurst')
My program is a Java project that is also using ImmutableLists. However, I am using version more uptodate. how can I find out what version Matlab is using? How can I determine which jar file is hiding the ImmutableList? How can I enforce Matlab to rank my jar file higher?
Best regards Thomas

Best Answer

Hi,
the jar file containing the ImmutablesLists is:
C:\Program Files\MATLAB\R2011a\java\jarext\google-collect.jar
I think there is no way to force MATLAB to rank your file higher. The only way I see it to remove this jar from the JavaClasspath and add yours. But I wont recommend this since this can lead to MATLAB crashes and/or strange behavior.
Related Question