How can I see the java classes that I used in my standalone applications?

3 次查看(过去 30 天)
Hello. Thank you for reading my question.
I develop the standalone applications using MATLAB Compiler. I make serial communication program with GUI.
When I make app and execute, javaclass missing error bothers me. So I solved this problem for adding instrument.jar and testmeas.jar in classpath.txt.
But, I don't know why adds the 2 jar file.
I want to know that what must be added in classpath. Can I see the list of jar file that is needed for my application? Is there matlab function?
Thank you for your attention.

回答(1 个)

Harsheel
Harsheel 2015-7-27
You can indirectly find the JAVA classes that your application loads.
>> [a1,b1,c1] = inmem;
>> run your application
>> [a2,b2,c2] = inmem;
>> setdiff(c2,c1)
c1 and c2 lists the JAVA classes loaded in MATLAB. c2 - c1 will list the extra JAVA classes loaded by your application. The common ones in c1,c2 were most likely loaded by MATLAB and you don't have to worry about them as some of these are not required when you run your compiled application and some are already included with the compiled application.
Note that the issue related to compiling serial function was very specific where the correct .jar files were not picked up during compilation. For the most part, you won't have to do detective work on which .jar files have to be added to the classpath so that the compiled application runs fine. This will be done automatically if the .jar file is shipped with MATLAB.
That being said, the issue with serial command will be resolved soon.
  2 个评论
Youngwoong Kim
Youngwoong Kim 2015-7-27
Thank you for answering my question. The App in the computer installed MATLAB works well. But, The App in the computer without MATLAB doesn't work.
I can see the classes used in app. but, I still don't know whether which .jar files have to be added.
Harsheel
Harsheel 2015-7-28
You mentioned in the question that you already resolved the problem. Is that not true? What is the error message you are getting?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Java Package Integration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by