Clash with existing Jar files

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

 채택된 답변

Friedrich
Friedrich 2011년 8월 10일

0 개 추천

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.

댓글 수: 2

T
T 2011년 8월 10일
Friedrich, thanks for your quick reply
I added an updated guava.jar (google-collect has been retired a while ago) and deleted google-collect.jar. I find it really irritating that MathWorks is producing such a mess with like 300 jar files even in the basic installation. I suggest them to rename the external jar files, e.g. instead of com.google.... they should rename them to com.mathworks.google...
This will remove quite some pain integrating Java tools for me.
Thomas
T
T 2011년 8월 10일
Of course, I had to edit classpath.txt...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

T
T
2011년 8월 10일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by