View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0012655 | CMake | CMake | public | 2012-01-04 12:21 | 2016-06-10 14:31 | ||||
Reporter | André Caron | ||||||||
Assigned To | Kitware Robot | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | moved | ||||||
Platform | 32-bit, 64-bit | OS | Windows | OS Version | Windows 7 | ||||
Product Version | CMake 2.8.5 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0012655: 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. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | ![]() | ||||||||
Relationships | |
Relationships |
Notes | |
(0028161) André Caron (reporter) 2012-01-04 12:31 |
Updated to CMake 2.8.7 and the latest version of JOM (tip of master branch) and still get the exact same error. |
(0028162) André Caron (reporter) 2012-01-04 12:37 |
If I manually edit the "build.make" file to put on "java" instead of "C:/Windows/System32/java.exe", jom runs sucessfully. Putting forward slashes in the path does not change the results. However, modifying the "CMakeLists.txt" to use only "java" would ignore all the hard work done by the FindJava module. This is definitely some issue with CMake that cannot spawn Java when using an absolute path to Java. |
(0028163) Rolf Eike Beer (developer) 2012-01-04 13:36 |
Is your JOM a 64 bit executable? Then java may be sitting in SystemWoW64 (or however this is called) which only maps to System32 for a 64 bit process. |
(0028164) André Caron (reporter) 2012-01-04 13:43 |
Yes, JOM is a 64-bit process. I'll build a 32-bit version and see if it helps. |
(0028165) André Caron (reporter) 2012-01-04 13:55 |
Using a 32-bit JOM version solves the problem. However, the 64-bit NMake (found using the Visual Studio 64-bit Command Prompt) still produces the problem. Java, as found by the FindJava module cannot start if run from a 64-bit NMake instance. |
(0028166) André Caron (reporter) 2012-01-04 14:05 |
I can also confirm that replacing "C:\Windows\System32\java.exe" with "C:\Windows\SysWOW64\java.exe" in the generated "build.make" scripts allows running both 64-bit NMake and 64-bit JOM successfully. |
(0028167) Rolf Eike Beer (developer) 2012-01-04 14:16 |
So the issue is not Java specific, but would happen to every program that is installed in a Windows special path with a 32 bit CMake (which is the default on Windows) and a 64 bit build program. |
(0028168) André Caron (reporter) 2012-01-04 14:28 |
Indeed, the issue lies with invoking a program in (at least) "C:\Windows\System32" from a 64-bit build system. This should affect all "Find*" modules that resolve absolute paths to this location. Are there any other "special paths" that change between 32-bit and 64-bit programs on 64-bit Windows? |
(0030346) David Cole (manager) 2012-08-11 21:09 |
Sending old, never assigned issues to the backlog. (The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...) If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^] It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing. |
(0041954) Kitware Robot (administrator) 2016-06-10 14:28 |
Resolving issue as `moved`. This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
Notes |
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 | |
2012-01-04 12:31 | André Caron | Note Added: 0028161 | |
2012-01-04 12:37 | André Caron | Note Added: 0028162 | |
2012-01-04 13:36 | Rolf Eike Beer | Note Added: 0028163 | |
2012-01-04 13:43 | André Caron | Note Added: 0028164 | |
2012-01-04 13:55 | André Caron | Note Added: 0028165 | |
2012-01-04 14:05 | André Caron | Note Added: 0028166 | |
2012-01-04 14:16 | Rolf Eike Beer | Note Added: 0028167 | |
2012-01-04 14:28 | André Caron | Note Added: 0028168 | |
2012-08-11 21:09 | David Cole | Status | new => backlog |
2012-08-11 21:09 | David Cole | Note Added: 0030346 | |
2016-06-10 14:28 | Kitware Robot | Note Added: 0041954 | |
2016-06-10 14:28 | Kitware Robot | Status | backlog => resolved |
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved |
2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot |
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |