14. Makefile error make (e=2): The system cannot find the file specified
- when compile Qt for android in Windows Environment, crash the following case:
cannot find E:\Qt\qtbase\src\android\jar\QtAndroid.jar
jar cf QtAndroid.jar -C .classes .
process_begin: CreateProcess(NULL, jar cf QtAndroid.jar -C .classes ., ...) failed.
make (e=2): The system cannot find the file specified
almost certainly complaining that Windows cannot find ‘jar’.
This is almost certainly because the value of %PATH% (or whatever) is different when make spawns a shell/console then when you have it open manually.
Compare the values to confirm that. Then either use the full path to ‘jar’ in the makefile recipe or ensure that the value of PATH is set correctly for make’s usage
in console , print ‘where java’,then show the full path of java.exe;
but when print ‘where jar’,cannot show the full path of ‘jar.exe’;
in path %JAVA_HOME%\bin, we can find jar.exe essentially, but now we cannot;when we check the JAVA folder in other PC ,we find that file ‘jar.exe’;
then copy the qt source code, compile java code,
run ‘jar cf QtAndroid.jar -C .classes .’;
that work OK;so the java environment maybe has been broken sometimes when we install other program;
copy the jar.exe into the target PC or reinstall JDK in the target PC,
then check,OK,we solve this problem;besides this,when search this topic key words,we find the similar question;
almost certainly complaining that Windows cannot find some target process,what we should do is locate the target process path,make the compiler know the path,
find the target process in the path;fro more information, please visit