I am using windows 7 and Gradle 1.8. My working Directory is “$tomcatHome/bin”.
I have a task startTomcat and it fails starting tomcat with the following error “‘catalina.bat’ is not recognized as an internal or external command, operable program or batch file”.
I tried couple of other batch files in “$tomcatHome/bin” like startup.bat, but it fails every time.
task startTomcat -
task startTomcat(type:Exec){
onlyIf {
tomcatHome != null
}
println “New Tomcat start method…”
println "tomcat Home is: " + tomcatHome
def catalinaOpts = “-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:PermSize=512M -Xms1024m -Xmx4096m”
def jdpaOpts = “-Xdebug -Xrunjdwp:transport=dt_socket,address=8100,server=y,suspend=n”;
workingDir “$tomcatHome/bin”
environment(“appconfig”, “$tomcatHome/appconfig”)
environment(“CATALINA_HOME”, “$tomcatHome”)
environment(“CATALINA_BASE”, “$tomcatHome”)
environment(“CATALINA_OPTS”, “$catalinaOpts”)
environment(“JAVA_OPTS”, “$catalinaOpts”)
environment(“JDPA_OPTS”, “$jdpaOpts”)
commandLine ‘cmd’, ‘/c’, ‘catalina.bat’
if (project.hasProperty(“debug”)) {
args ‘jpda,start’
}
else{
args ‘start’
} } startTomcat.dependsOn(deploy) deploy.dependsOn(undeploy)
I am not able to figure out why exactly this is happening, I made sure that the path to the working directory is correct. Any help would be appreciated.
Thanks, Bodhan