问题描述
- matlab m文件构建成Java 报错不知道是什么错误
-
m文件内容是:
function [sum] = oper(a,b);
sum = a + b;
end
出错的错误是:正在构造 Javadoc 信息...
标准 Doclet 版本 1.8.0_40
正在构建所有程序包和类的树...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmloperClass1.html...
C:UsersAdministratorDocumentsMATLABoperfor_testingoperClass1.java:110: 警告: args没有 @param
public static void main (String[] args)
^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperClass1.java:60: 警告: com.mathworks.toolbox.javabuilder.MWException没有 @throws
public Class1() throws MWException
^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperClass1.java:89: 警告: com.mathworks.toolbox.javabuilder.MWException没有 @throws
public Class1(MWComponentOptions componentOptions) throws MWException
^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperClass1.java:78: 警告: com.mathworks.toolbox.javabuilder.MWException没有 @throws
public Class1(String pathToComponent) throws MWException
^
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmloperClass1Remote.html...
C:UsersAdministratorDocumentsMATLABoperfor_testingoperClass1Remote.java:59: 错误: 找不到引用
* @throws java.jmi.RemoteException An error has occurred during the function call or
^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperClass1Remote.java:62: 警告: java.rmi.RemoteException没有 @throws
public Object[] oper(int nargout, Object... rhs) throws RemoteException;
^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperClass1Remote.java:65: 警告: java.rmi.RemoteException没有 @throws
void dispose() throws RemoteException;
^
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmloperOperMCRFactory.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmloperpackage-frame.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmloperpackage-summary.html...
C:UsersAdministratorDocumentsMATLABoperfor_testingoperpackage-info.java:8: 警告:标记为空
- ^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperpackage-info.java:15: 错误: 意外的结束标记: - ^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperpackage-info.java:21: 警告:
标记为空 - ^
C:UsersAdministratorDocumentsMATLABoperfor_testingoperpackage-info.java:27: 错误: 意外的结束标记: - ^
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmloperpackage-tree.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmlconstant-values.html...
正在构建所有程序包和类的索引...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmloverview-tree.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmlindex-all.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmldeprecated-list.html...
正在构建所有类的索引...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmlallclasses-frame.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmlallclasses-noframe.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmlindex.html...
正在生成C:UsersAdministratorDocumentsMATLABoperfor_testingdochtmlhelp-doc.html...
3 个错误
8 个警告
Error: An error occurred while shelling out to javadoc (error code = 1).
Unable to build executable.
- ^
解决方案
我也遇到了相同的问题,据说是JDK版本太高了,换成1.7或者1.6,还没有进行实验验证。
解决方案二:
亲测,matlab 2014a 用jdk1.7
matlab 2013a 用jdk1.6