本文介绍了matlab deploytool到java包javac错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试包装我的程序以使用Java.我首先尝试了一个简单的"hello world",

I'm trying to wrap a program of mine to work with java.I tried a simple "hello world" first,

-hello world.m-

-hello world.m-

我使用了deploytool并选择了Java包.

I used deploytool and selected java package.

到达此行时:执行命令:"javac -verbose -classpath" C:\ Program Files \ MATLAB \ R2009b \ toolbox \ javabuilder \ jar \ javabuilder.jar"-d" C:\ Users \ shachar \ Documents \ MATLAB \ deployTutorial \ deployTutorial2 \ src \类" C:\ Users \ shachar \ Documents \ MATLAB \ deployTutorial \ deployTutorial2 \ src \ deployTutorial2 \ helloworld.java" C:\ Users \ shachar \ Documents \ MATLAB \ deployTutorial \ deployTutorial2 \ src \ deployTutorial2 \ DeployTutorial2MCRFactory.java""C:\ Users \ shachar \ Documents \ MATLAB \ deployTutorial \ deployTutorial2 \ src \ deployTutorial2 \ helloworldRemote.java""C:\ Users \ shachar \ Documents \ MATLAB \ deployTutorial \ deployTutorial2 \ src \ deployTutorial2 \ package-info.java"

when it reached this line:Executing command: "javac -verbose -classpath "C:\Program Files\MATLAB\R2009b\toolbox\javabuilder\jar\javabuilder.jar" -d "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\classes" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\helloworld.java" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\DeployTutorial2MCRFactory.java" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\helloworldRemote.java" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\package-info.java""

我收到此错误:无法将"javac"识别为内部或外部命令,可操作的程序或批处理文件.错误:炮轰到javac时发生错误(错误代码= 1).无法生成可执行文件.

I got this error:'javac' is not recognized as an internal or external command,operable program or batch file.Error: An error occurred while shelling out to javac (error code = 1).Unable to build executable.

btw:当我尝试独立应用程序/c/c ++共享库时,它已成功编译.

btw: when I tried standalone application / c/c++ shared library it has been compiled successfully.

预先感谢

推荐答案

可能您的计算机上未安装或未正确配置Java SDK.打开系统终端并执行以下两个命令:

Possibly the Java SDK is not installed or properly configured on your machine. Open a system terminal and execute the following two commands:

java -version
javac -version

如果它们都起作用,则应继续使用MATLAB帮助中的示例.如果未安装,则安装Java SDK.

If they both work you should proceed with the examples from the MATLAB help. If not install the Java SDK.

这篇关于matlab deploytool到java包javac错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 04:52