failed to generate java files when using libarary package
古いコメントを表示
error during packaging:

the log file:

copy the "following command"and run in cmd:

(the error messge above means that the link16.java is not found.)
It seems that the java files are compiled by javac while they havn't yet been generated. I can't figure out why, as the packaging worked well last day, and after I added more MEX files, it failed like above. Now even a new packaging project can not package successfully. Additionally, the "Files required for your libarary to run" list contains several P-coded files, could these files have caused it?
I'll be appreciate it if someone can help me to figure out what cause the confuing error.
回答 (1 件)
Hitesh
2025 年 1 月 16 日
Hi 浩,
The error message you are encountering is due to incompatibility with Java configuration.
Kindly follow the following troubleshooting steps to resolve this issue:
Verify Java Installation:
- Ensure that Java is installed correctly on your system. You can check this by running following commands in your command prompt. Both commands will return version information.
java -version
javac -version
- Ensure that the Java Development Kit (JDK) is installed, not just the Java Runtime Environment (JRE), as "javac" is part of the JDK.
Check JAVA_HOME Environment Variable:
- Ensure that the "JAVA_HOME" environment variable is set correctly to the JDK installation path. For instance, it has to be something like "C:\Program Files\Java\jdk-11".
- Add "%JAVA_HOME%"\bin to your system's PATH environment variable.
MATLAB Compiler Configuration:
- Ensure that MATLAB is configured to use the correct Java version. You can check and set the Java version in MATLAB by using the following command.
version -java
カテゴリ
ヘルプ センター および File Exchange で Call Java from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!