Java 1.8 with Matlab 2015b on Windows 7

3 ビュー (過去 30 日間)
Charles Teasley
Charles Teasley 2016 年 4 月 20 日
回答済み: Charles Teasley 2016 年 5 月 3 日
I am using MATLAB 2015b (and by default Java 1.7.0_60). My system (and Netbeans) is using Java 1.8. Will this prevent me from accessing Java Classes (a Java GUI I created) in MATLAB? I have tried everything, and MATLAB never gets access to the Java classes. The jar file is in the path, but MATLAB gives the error mesage "Undefined variable 'GOUI' or class 'GOUI.GOJPanel'.
code snip-it**************
function GenOneJava = main()
javaaddpath ('c:\Users\cteasley\Documents\MATLAB\Active Projects\GenOneJava\GenOneGUI.jar');
jFrame = GOUI.GOJPanel();
end
end Code snip-it*************
MATLAB Console***************
methodsview GOUI.GOJPanel
Returns:
NO class GOUI.GOJPanel can be located or no methods for class.
Many thanks,
Charles

回答 (2 件)

Malcolm Lidierth
Malcolm Lidierth 2016 年 5 月 3 日
In Netbeans, edit the Preferences to target Java 1.7 or earlier when you do a build. All should then be OK.

Charles Teasley
Charles Teasley 2016 年 5 月 3 日
Thank you! Under normal circumstances, I would. The "Preferences" changes the text file that has the compiler path. Of course, our SysAdmins have disabled any changes by someone who isn't the admin. I had to get them to give me write privileges in the Netbeans directory. I understand security, but we are the people that know how to admin our own workstations. Cyber security says to trust no one. I guess that is what they do.

カテゴリ

Help Center および File ExchangeJava Package Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by