[cmake-developers] [CMake 0012655]: Cannot run Java from FindJava when using JOM

Mantis Bug Tracker mantis at public.kitware.com
Wed Jan 4 12:21:52 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=12655 
====================================================================== 
Reported By:                André Caron
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12655
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-01-04 12:21 EST
Last Modified:              2012-01-04 12:21 EST
====================================================================== 
Summary:                    Cannot run Java from FindJava when using JOM
Description: 
I have a CMake project that invokes Java to run PlantUML[1].  The CMake script
runs fine when using NMake ("NMake Makefiles" generator) but fails to run when
using JOM[2] ("NMake Makefiles JOM" generator).

The error message printed by JOM is:

> 'C:\Windows\System32\java.exe' is not recognized as an internal or external
command, operable program or batch file.

The corresponding command in the "build.make" file for the target is:

> C:\Windows\System32\java.exe -jar
C:/Users/carona/software/plantuml/7284/plantuml.jar -o
C:/Users/carona/Desktop/projects/jom-java-path-bug/work/jom -tpng
C:/Users/carona/Desktop/projects/jom-java-path-bug/demo-sequence-diagram.uml

If I run this command from a regular windows command prompt, it works just fine.
 Moreover, the corresponding command using the NMake generator is:

> C:\Windows\System32\java.exe -jar
C:/Users/carona/software/plantuml/7284/plantuml.jar -o
C:/Users/carona/Desktop/projects/jom-java-path-bug/work/nmake -tpng
C:/Users/carona/Desktop/projects/jom-java-path-bug/demo-sequence-diagram.uml

This command also runs fine from a regular command prompt.

At first, I though it had something to do with the backslashes and tried to emit
a command that contained only forward slashes by using the
"get_filename_component(... ABSOLUTE)" command.  Outputting the resulting paths
to the console via a "status(MESSAGE ...)" command confirms that the path
contains no backslashes.  However, the command in the "build.cmake" file
*always* contains forward slashes for the program path.  It seems that the
"add_custom_command()" call that generates the command in question enforces
backward slashes for the verb (program name).

Further investigating this issue, I also noticed that when using the 64-bit
Visual Studio tools, NMake can no longer generate the diagrams either and
produces the following message:

> 'C:\Windows\System32\java.exe' is not recognized as an internal or external
command, operable program or batch file.

Attached to this message is the smallest possible project that reproduces the
problem.  It contains current outputs with logs containing the outputs of each
command.  Included in the archive is a "run.bat" script that contains the exact
commands I used to generate the outputs.

Thanks for looking at this!  This issue is problematic for me since I can not
render my UML diagrams and use parallel builds with the same configuration.

[1]: http://plantuml.sourceforge.net/
[2]: http://qt.gitorious.org/qt-labs/jom

Steps to Reproduce: 
1. Download and unpack the attached project.
2. Follow instructions in the "run.bat" script.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-01-04 12:21 André Caron    New Issue                                    
2012-01-04 12:21 André Caron    File Added: jom-java-path-bug.zip              
     
======================================================================




More information about the cmake-developers mailing list