matlab deploytool到java包javac报错 [英] matlab deploytool to java package javac error
问题描述
我正在尝试包装我的程序以使用 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-
disp('你好世界');
disp('hello world');
我使用了 deploytool 并选择了 java 包.
I used deploytool and selected java package.
到达这一行时:执行命令:"javac -verbose -classpath "C:Program FilesMATLABR2009b oolboxjavabuilderjarjavabuilder.jar" -d "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2src类" "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2helloworld.java" "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2DeployTutorial2MCRFactory.java""C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2helloworldRemote.java" "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2package-info.java""
when it reached this line: Executing command: "javac -verbose -classpath "C:Program FilesMATLABR2009b oolboxjavabuilderjarjavabuilder.jar" -d "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcclasses" "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2helloworld.java" "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2DeployTutorial2MCRFactory.java" "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2helloworldRemote.java" "C:UsersshacharDocumentsMATLABdeployTutorialdeployTutorial2srcdeployTutorial2package-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.
顺便说一句:当我尝试独立应用程序/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报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!