Matlab cannot see some of my java classes (not all) in jar package

后端 未结 6 1223
不思量自难忘°
不思量自难忘° 2021-01-02 04:19

I have a problem that is driving me nuts. Matlab sees only some of my classes embeded in a JAR file

If I compile the classes outside of a package and add the path to

6条回答
  •  攒了一身酷
    2021-01-02 05:11

    To complement the accepted answer - there's a far better way to check if java class was loaded propertly, than through import command. Use whereisjavaclassloadingfrom function, provided by Andrew Janke in this answer.

    Not only it will tell you whether the class is loaded, it will list all jars that this class is available in. It happens quite often that your class gets masked / overshadowed by another class with the same package/name, located in a different jar. That can happen e.g. if you try to use a newer library than one of those shipped with Matlab, and do not place it above the original one on the static java classpath.

提交回复
热议问题