2009-06-30

NetBeans + Tomcat + Java for MacOS X 10.5 Update 4 = Fail

Just struggled with this for a couple of days. After updating MacOS X with the latest Java update (Java for MacOS X 10.5 Update 4, patching security holes mentioned in the news the last few weeks), I could no longer launch Tomcat from NetBeans. And that's a Bad Thing. I use NetBeans all day for work, on a web application that gets tested through the local copy of NetBeans.

The error I was getting was that it couldn't find a file/directory under "/var/folders/ZC/ZCcmX61vGaqOjbHwwgwW-k+++TI/-Tmp-/". The filename changes every time, in the format "context1234567890123456789.xml". The "+++" throws it off because the path is passed as a URL parameter to the Tomcat Manager, which converts the +'s to spaces.

The solution is to go to your NetBeans application folder, right-click the application, and choose Show Package Contents. Under Contents/Resources/NetBeans/etc, open netbeans.conf, and find the line for "netbeans_default_options". Go to the end of this line, and add, inside the end quote, "-J-Djava.io.tmpdir=/tmp". Restart NetBeans, and you should be good to go.