Local Tomcat run configuration - Cannot run catalina.bat

Answered

I have created Local Tomcat (8.5.15) run configuration in IntelliJ IDEA (2019.2). I am running Windows 10. When I try to run the configuration, I get error:

Error running 'Local Tomcat': Cannot run program "C:\apache-tomcat-8.5.15\bin\catalina.bat" (in directory "C:\apache-tomcat-8.5.15\bin"): CreateProcess error=2, The system cannot find the file specified

Environment variables are set:

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_221
CATALINA_HOME=C:\apache-tomcat-8.5.15

%JAVA_HOME%\bin and %CATALINA_HOME%\bin added to PATH

In Run/Debug Configurations -> Startup/Connection, Startup script and Shutdown script are set to valid paths:

C:\apache-tomcat-8.5.15\bin\catalina.bat run
C:\apache-tomcat-8.5.15\bin\catalina.bat stop

When run from terminal, Tomcat starts correctly.

I have replaced catalina.bat with some mock script (just echo sth) as Startup script in run configuration, got the same error. No other logs are visible in IntelliJ.

Any combination of environment variables does not solve the problem.

32bit and 64bit versions of IntelliJ+Java+Tomcat does not solve the problem.

Everything worked fine on Windows 7, problems happened when switched to Windows 10.

0
3 comments

Are there any errors logged in the Windows Event Viewer? There could be some antivirus/security software blocking the execution from IntelliJ IDEA.

You don't need to set up any environment variables for IntelliJ IDEA Tomcat integration to work. Tomcat configuration is taken from the Application Server settings, JDK configuration from the Project Structure | SDKs.

0
Avatar
Permanently deleted user

No related events display in Event Viewer.

0

Try reinstalling JDK and Tomcat. Configure them in IntelliJ IDEA from scratch. Disable the antivirus.

0

Please sign in to leave a comment.