Sunday, June 14, 2009

Netbeans / OSX / "BASEDIR environment variable is not defined correctly"

This one was frustrating. You get the error message "BASEDIR environment variable is not defined correctly" after installing Netbeans packaged with Tomcat, when you try to deploy your webapp to Tomcat within Netbeans. Try as you might, you cannot fix this with an environment variable. The problem is that the script "setclasspath.sh" in the bin directory of the Tomcat installation is not executable. Change all scripts in the bin directory to be executable and it works.

Along the way I learned that you can have a private configuration by checking the "Use Private Configuration Folder" box during the "Add Server" dialog sequence. If you select an empty directory, it wil be populated for you including an appropriate set of user credentials if you also select "Create user if it does not exist". Pretty easy.