matlab打包为Java程序出错

本文详细记录了在使用MATLAB调用Java组件时遇到的编译错误,包括javac和javadoc的错误代码1,以及多个具体错误信息,如参数注释缺失、意外的结束标记等。文中提供了可能的问题原因及解决方案,包括检查Java安装和环境变量配置,调整jdk版本一致性,以及避免路径中包含中文字符。

报错:ERROR:an error occurred while shelling out to javac(Error code = 1)

C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:119: 警告: args没有 @param
    public static void main (String[] args)
                       ^
C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:149: 错误: 意外的结束标记: 

 

*

 

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:176: 错误: 意外的结束标记:

 

*

 

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:208: 错误: 意外的结束标记:

 

*

 

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:237: 错误: 意外的结束标记:

 

*

 

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:268: 错误: 意外的结束标记:

 

*

 

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:304: 错误: 意外的结束标记:

 

*

 

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:69: 警告: com.mathworks.toolbox.javabuilder.MWException没有 @throws public feature() throws MWException ^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:98: 警告: com.mathworks.toolbox.javabuilder.MWException没有 @throws public feature(MWComponentOptions componentOptions) throws MWException ^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\feature.java:87: 警告: com.mathworks.toolbox.javabuilder.MWException没有 @throws public feature(String pathToComponent) throws MWException ^ 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\feature_exta\Feature_extaMCRFactory.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\feature_exta\featureRemote.html... C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\featureRemote.java:60: 错误: 找不到引用 * @throws java.jmi.RemoteException An error has occurred during the function call or ^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\featureRemote.java:63: 警告: java.rmi.RemoteException没有 @throws public Object[] feature_exta(int nargout, Object... rhs) throws RemoteException; ^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\featureRemote.java:93: 错误: 找不到引用 * @throws java.jmi.RemoteException An error has occurred during the function call or ^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\featureRemote.java:96: 警告: java.rmi.RemoteException没有 @throws public Object[] sigIntegral(int nargout, Object... rhs) throws RemoteException; ^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\featureRemote.java:99: 警告: java.rmi.RemoteException没有 @throws void dispose() throws RemoteException; ^ 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\feature_exta\package-frame.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\feature_exta\package-summary.html... C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\package-info.java:8: 警告:

标记为空 *

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\package-info.java:15: 错误: 意外的结束标记:

*

 

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\package-info.java:20: 警告:

标记为空 *

^ C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\feature_exta\package-info.java:26: 错误: 意外的结束标记:

*

 

^ 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\feature_exta\package-tree.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\constant-values.html... 正在构建所有程序包和类的索引... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\overview-tree.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\index-all.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\deprecated-list.html... 正在构建所有类的索引... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\allclasses-frame.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\allclasses-noframe.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\index.html... 正在生成C:\Users\asus-pc\Desktop\soft\feature_exta\for_testing\doc\html\help-doc.html... 10 个错误 9 个警告 Error: An error occurred while shelling out to javadoc (error code = 1). Unable to build executable. For more information, pass the -v option to mcc.


可能的问题及解决方案如下:         

当前系统java未安装,环境变量未配置。步骤:https://jingyan.baidu.com/article/08b6a591bdb18314a80922a0.html
更换jdk版本后,MATLAB调用的jdk版本与系统环境变量配置的版本不一致。见:https://blog.youkuaiyun.com/it_beecoder/article/details/74011112
路径包含中文,将用到的文件和保存路径全改为英文。
 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值