2

我尝试在 ANT 下运行 Activiti BPM 工具,但出现以下错误:- 错误:- 'java' 未被识别为内部或外部命令;当我尝试在 Windows 7 下使用 CMD 命令行启动演示应用程序时,出现以下错误:-

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

有谁知道出了什么问题?BR

4

3 回答 3

4

错误:- 'java' 未被识别为内部或外部命令;

这意味着它java.exe不是您的PATH.
添加%JAVA_HOME%\bin到您的PATH哪里JAVA_HOME是您的 java 安装目录

于 2012-08-26T12:01:48.053 回答
3

只需添加C:\Program Files\Java\jdk1.7.0_06\bin到您的 PATH。

原因是批处理文件C:\activiti-5.10\activiti-5.10\apps\h2\h2.start.bat有一个java依赖于java.exePATH 的原始命令。

于 2012-08-26T12:09:27.900 回答
0

我有一个类似的问题。出于某种原因,Java JDK 已正确安装在 C:\Program Files (x86)\Java路径中设置为 C:\Program Files\Java ... 一旦我更正了路径变量,它就解决了这个问题。

此外,请注意您是否让 Jenkins 和 Java 使用相同的端口号,这可能会导致看起来一切正常,您需要让它们使用单​​独的端口号。要检查此停止 Jenkins 是否作为服务运行,然后重新启动 Tomcat

于 2013-10-23T08:52:03.347 回答