loading and using a .jar file
59 次查看(过去 30 天)
显示 更早的评论
Hello, I have practically no knowledge of using java in matlab.
I have looked around online and all I could find regarding pulling in java into matlab was javaaddpath. I used this command to add the .jar file to my path, and it shows up. What happens next? How do I find out what is in it? How do I use it? Etc.?
Any help? Thanks in advance!
0 个评论
回答(1 个)
Laura Proctor
2011-4-12
To obtain a listing of all the Java classes that are currently loaded:
[M,X,J] = inmem
import pkg_name.* % Import all classes in package
value = java.lang.Integer(0);
fieldnames(value, '-full')
methodsview java.awt.MenuItem
I hope that this gives you a good starting point! Best of luck.
1 个评论
Abdul-Kareem
2014-6-24
Hi. sorry for bumping this but I wanted clarification.
After adding a jar or class or package to the static or dynamic path, what must the package name be when you say: import pkg_name.*
And I don't understand this terminology: methodsview java.awt.MenuItem
How do you go from your jar or class file name to java.awt.MenuItem? How do you find the full names of java files?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Java from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!