Determine location of a java class loaded by Matlab

前端 未结 5 1814
无人及你
无人及你 2020-12-04 00:40

When using java from Matlab, is there some way to figure out from where in matlab\'s java class path is a class being loaded? I\'m trying to diagnose a error caused by confl

5条回答
  •  余生分开走
    2020-12-04 01:16

    Per Thorbjørn Ravn Andersen, if j reference to a java object in Matlab, its location can be retrieved with the following line of matlab code:

    j.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()
    

提交回复
热议问题