フィルターのクリア

matlab java interface--can not add the user-defined class to the Java class path

4 ビュー (過去 30 日間)
zhang
zhang 2015 年 1 月 7 日
コメント済み: Geoff Hayes 2015 年 1 月 8 日
I coded a simple class: test and compiled it and put it in the 'D:\Dropbox\projects\ICPR2013\code\java\union_find'.
public class test {
public test() {
System.out.printf("hello world!");
}
}
And then I use the following code to bring the defined class to the Java class path. I also use javaclasspath to make sure that the folder including 'test' class is added to the Java class path.
javaaddpath('D:\Dropbox\projects\ICPR2013\code\java\union_find');
But when I use x = javaObjectEDT('test'); to call the 'test' class, it gives me the following error: No class test can be located on Java class path
  1 件のコメント
Geoff Hayes
Geoff Hayes 2015 年 1 月 8 日
zhang - have you verified that the test.class file is in the D:\Dropbox\projects\ICPR2013\code\java\union_find folder? I used your code for the test class and was able to create an instance of it. I added the folder to the java path using a similar call to javaaddpath and then just observed
>> x = javaObjectEDT('test');
hello world!>> x
x =
test@13265564

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeExternal Language Interfaces についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by