failed to generate java files when using libarary package

2 visualizaciones (últimos 30 días)
浩
el 2 de Abr. de 2024
Respondida: Hitesh el 16 de En. de 2025
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.

Respuestas (1)

Hitesh
Hitesh el 16 de En. de 2025
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

Categorías

Más información sobre Call Java from MATLAB en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by