Why do I get error: package com.mathworks.toolbox.javabuilder.internal does not exist in Java program which uses MATLAB Compiled JARs
4 views (last 30 days)
Show older comments
MathWorks Support Team
on 6 Feb 2018
Answered: MathWorks Support Team
on 6 Feb 2018
I created JAR file from MATLAB using example given on the following doc-
But, in Step 16 I am getting the error-
error: package com.mathworks.toolbox.javabuilder.internal does not exist
How to fix this?
Accepted Answer
MathWorks Support Team
on 6 Feb 2018
I understand that you created the JAR file from MATLAB code and now trying to import this into a sample JAVA program.
While compiling the program you get the error-
error: package com.mathworks.toolbox.javabuilder.internal does not exist
import com.mathworks.toolbox.javabuilder.*;
^
and cannot find symbol errors for MWArray and MWNumericArray.
This all happens because the import com.mathworks.toolbox.javabuilder could not successfully import javabuilder.
The most possible reason for this is that full path to "javabuilder.jar" is not added to the _classpath_.
Compile your program as-
javac -classpath _"mcrroot_\toolbox\javabuilder\jar\javabuilder.jar";.\makesqr.jar .\getmagic.java
Note that _mcrroot _is the path to where the MATLAB Runtime is installed on your system. If you have MATLAB installed on your system instead, you can use the path to your MATLAB installation
Verify that javabuilder.jar file exists on the location.
0 Comments
More Answers (0)
See Also
Categories
Find more on Deploy to C++ Applications Using mwArray API (C++03) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!