How execute a jar generated with Compiler SDK from windows prompt.
4 次查看(过去 30 天)
显示 更早的评论
I have generated a java library named example.jar.
I have already setted JAVA_HOME and CLASSPATH as follow:
JAVA_HOME:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/806739/image.png)
CLASSPATH:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/806744/image.png)
Path with jdk:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/806749/image.png)
Java version from MAtlab command line:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/806754/image.png)
My function takes 3 inputs (3 paths) and has no outputs.
Once the jar has been created I am trying to launch jar file from windows prompt with the following command:
java -cp MyJar.jar "C:\Program Files\MATLAB\R2021b\toolbox\javabuilder\jar\javabuilder.jar" 'path\file1' 'path\file2' 'path\file3'
And I'm receving the following error:
Error: impossible to find or upload the main class C:\Program Files\MATLAB\R2021b\toolbox\javabuilder\jar\javabuilder.jar
Caused by: java.lang.ClassNotFoundException: C:\Program Files\MATLAB\R2021b\toolbox\javabuilder\jar\javabuilder.jar
Any suggestion?
0 个评论
回答(1 个)
Sean de Wolski
2021-11-19
I'd strongly recommend that you create a "sample" with the Compiler SDK. Then the output will contain a getting started guide with the exact steps to run that sample and the sample will execute:
4 个评论
Sean de Wolski
2021-11-22
Do you have the Computer Vision toolbox on the trial license for compiler?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!