'Warning the selected directory is not a valid tomcat home
I installed Tomcat with home brew brew install tomcat. On Selecting Tomcat server to add a server to the application server I get this
Warning the selected directory is not a valid tomcat home.
However, running catalina start starts the tomcat server on my terminal.
Solution 1:[1]
If you are using IDEA on Linux platform, use the command:
chmod 755 -R apache-tomcat-<<Your-tomcat-version>>
Then try to restart your service again.
Solution 2:[2]
Try selecting the libexec subdirectory in IntelliJ - i.e. /usr/local/Cellar/tomcat/8.5.9/libexec
Solution 3:[3]
Problem:
This happens because intellijIDEA doesn't have enough permission to read and write on the tomcat home folder, this happens on linux machines.
Solution
let your tomcat root folder = "/opt/tomcat" then this command which will set the right privilege level for intellijIDEA.
$ sudo chmod 755 -R /opt/tomcat
Solution 4:[4]
This recently came up for me on Ubuntu 17.04
What worked for me
cd /var/lib/tomcat8
rmdir lib/
ln -s /usr/share/tomcat8/lib/ .
ln -s /usr/share/tomcat8/bin/ .
I'm not sure this is the best fix but it worked for me. For some reason the default install left the tomcat8/lib directory empty while the real libraries are under the share directory.
Solution 5:[5]
I did what CallmeSurge suggested, except I had to change the following:
Step 3: Create a new Tomcat Runtime Configuration
- Select the Runtime Configurations box (top right hand corner of the screen), and select Edit Configurations.
- Select the green + sign at the top left corner of the box.
- Select Tomcat (you may have to expand the box to see it)
- Give your new configuration a name
- In the Server tab, in the Application Server box, select the tomcat folder you created in steps 1 and 2.
- In the Deployment tab, select the build artifact you want to deploy. (Note: if you don't have a build artifact configured for your project, you'll have to configure one first).
- Save the new configuration.
Now, deploying to tomcat is as easy as selecting the runtime configuration you just created and hitting the Debug or Run arrows.
Solution 6:[6]
Authorise permissions on Tomcat folder:
Open tomcat location e.g. C:\Program Files\Apache Software Foundation\Tomcat 9.0
Double click this folder.
Authorise permissions.
Now try creating the server...
Solution 7:[7]
There may be a situation where the folder will be inaccessible to the user due to lack of rights. Try to open the root folder of Tomcat and click OK to get rights to it. This worked for me.
Solution 8:[8]
In Windows I just executed Intellij as administrator and it solved my problem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Fritz Duchardt |
| Solution 2 | Stepan |
| Solution 3 | |
| Solution 4 | kervin |
| Solution 5 | teuber789 |
| Solution 6 | |
| Solution 7 | Evgeniy |
| Solution 8 | Pedro Gonçalves |


