getting error while using java builder for converting matlab code to java.....
1 view (last 30 days)
Show older comments
The error is: Exception in thread "main" java.lang.ExceptionInInitializerError at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getMCRRoot (MCRConfiguration.java:92)
plz help me out
0 Comments
Answers (1)
arushi
on 28 Aug 2024
Hi Ashish,
The error message you are encountering suggests that there is an issue with the MATLAB Compiler Runtime (MCR) configuration. This kind of error typically arises when trying to run a Java application that relies on MATLAB code compiled with MATLAB Compiler SDK. Here are some steps you can take to troubleshoot and resolve the issue:
1. Verify MCR Installation:
- Ensure that the MATLAB Compiler Runtime (MCR) is installed on your system. The version of the MCR must match the version of MATLAB used to compile the application.
2. Set Environment Variables:
- Make sure that the environment variables are correctly set for the MCR. You need to set `MATLAB_RUNTIME` or `MCR_ROOT` to the installation directory of the MCR.
- On Windows, you might need to add the path to the MCR's `bin` directory to your `PATH` environment variable. On Linux or macOS, you might need to update your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH`.
3. Check Java Version:
- Ensure that the Java version you are using is compatible with the MATLAB Compiler SDK. Mismatched Java versions can cause initialization errors.
4. Check Log Files:
- If available, check any log files generated by the application for more detailed error messages that might give further clues about the problem.
Hope this helps.
0 Comments
See Also
Categories
Find more on Android Devices 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!