unable to call the java function in my .jar

In eclipse, the .java is in MyProject->src->Mypacket->myclass.java
I use export to export the jar and put in in to the root folder of matlab
then I use the javaaddpath and can see the path below DYNAMIC JAVA PATH using javaclasspath
But I can call my function
methodsview ReverseImageSearch also return
No class ReverseImageSearch can be located or no methods for class

回答 (1 件)

Geoff Hayes
Geoff Hayes 2014 年 4 月 30 日
編集済み: Geoff Hayes 2014 年 4 月 30 日

0 投票

Hi Chan,
I can replicate your issue if I load my collective.jar file and try to view the methods of the Radix2FFT java class:
javaaddpath /Users/geoff/Development/java/collective.jar
methodsview Radix2FFT
Error using methodsview (line 100)
No class Radix2FFT can be located or no methods for class
The problem is that I am not making use of the package name. If I list the contents of my jar file (outside of MATLAB, in a terminal window), I see that:
>> jar tf collective.jar
META-INF/MANIFEST.MF
com/geoff/dsp/Radix2FFT.class
com/geoff/dsp/Other.class
So in order to list the class methods (or even instantiate an instance of the class) I have to type:
methodsview com.geoff.dsp.Radix2FFT
Please try the above and see what happens.
Geoff

カテゴリ

ヘルプ センター および File ExchangeCall Java from MATLAB についてさらに検索

タグ

質問済み:

2014 年 4 月 29 日

編集済み:

2014 年 4 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by