2

I have tried to run the Activiti BPM tool under ANT but i am getting the following error :- ERROR:- 'java' is not recognized as an internal or external command; when i tried to start a demo application using CMD command line under windows 7 i got the following error:-

C:\activiti-5.10\activiti-5.10\setup>ant demo.start
    Buildfile: C:\activiti-5.10\activiti-5.10\setup\build.xml

    demo.install:

    internal.cfg.create:
     [copy] Copying 1 file to C:\activiti-5.10\activiti-5.10\setup\build\activit
i-cfg
      [zip] Building zip: C:\activiti-5.10\activiti-5.10\setup\build\activiti-cf
g.jar
     [echo] copying configuration to ../workspace/activiti-engine-examples/src/m
ain/config
    [unzip] Expanding: C:\activiti-5.10\activiti-5.10\setup\build\activiti-cfg.j
ar into C:\activiti-5.10\activiti-5.10\workspace\activiti-engine-examples\src\ma
in\config

internal.classpath.libs:

internal.taskdef.launch:

h2.start:
     [echo] starting H2 database...
   [launch] launching cmd 'C:\activiti-5.10\activiti-5.10\apps\h2\h2.start.bat '
 in dir 'C:\activiti-5.10\activiti-5.10\apps\h2'
   [launch] waiting for launch completion msg 'TCP server running'...
   [launch]   'java' is not recognized as an internal or external command,
   [launch]   operable program or batch file.
   [launch] launched process completed
     [echo] H2 database started

tomcat.start:
   [launch] launching cmd 'C:\activiti-5.10\activiti-5.10\apps\apache-tomcat-6.0
.32\bin\startup.bat ' in dir 'C:\activiti-5.10\activiti-5.10\apps\apache-tomcat-
6.0.32\bin'
   [launch] waiting for launch completion msg 'Using CLASSPATH:'...
   [launch]   Using CATALINA_BASE:   "C:\activiti-5.10\activiti-5.10\apps\apache
-tomcat-6.0.32"
   [launch]   Using CATALINA_HOME:   "C:\activiti-5.10\activiti-5.10\apps\apache
-tomcat-6.0.32"
   [launch]   Using CATALINA_TMPDIR: "C:\activiti-5.10\activiti-5.10\apps\apache
-tomcat-6.0.32\temp"
   [launch]   Using JRE_HOME:        "C:\Program Files\Java\jdk1.7.0_06"
   [launch]   Using CLASSPATH:       "C:\activiti-5.10\activiti-5.10\apps\apache
-tomcat-6.0.32\bin\bootstrap.jar"

explorer.browser.open:

demo.start:

BUILD SUCCESSFUL
Total time: 5 seconds

Does anyone know what is going wrong ? BR

John John
  • 1
  • 72
  • 238
  • 501

3 Answers3

4

ERROR:- 'java' is not recognized as an internal or external command;

This means that java.exe is not part of your PATH.
Add %JAVA_HOME%\bin to your PATH where JAVA_HOME is your installation directory for java

Cratylus
  • 52,998
  • 69
  • 209
  • 339
3

Just add C:\Program Files\Java\jdk1.7.0_06\bin to your PATH.

The reason is that the batch file C:\activiti-5.10\activiti-5.10\apps\h2\h2.start.bat has a raw java command which relies on java.exe being on the PATH.

Reimeus
  • 158,255
  • 15
  • 216
  • 276
0

I had a similar issue. For some reason the java JDK was installed correctly on C:\Program Files (x86)\Java BUT in the path it was set to C:\Program Files\Java ... once I corrected the path variable it solved this issue.

Also, watch out if you have Jenkins and Java using the same port number this can cause the appearance that everything is ok by you will need to have them use separate port numbers. To check for this stop Jenkins if it is running as a service and then restart Tomcat