random technical thoughts from the Nominet technical team

OS X: Environment variables don’t work in IntelliJ’s ant support

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...
Posted by matt on Dec 20th, 2006

Running ant tasks from within IntelliJ that rely on environment variables doesn’t seem to work on OS X. I have an ant task that copies static files such as CSS and Freemarker templates to my local tomcat installation – this allows me to see updates much faster than performing a full deploy of the application. Under Mac OS X however, the CATALINA_HOME environment variable it relies upon cannot be seen by the ant task when running in IntelliJ. I have come up with a simple workaround:

On the ant pane, click the Settings icon. Then, on the Properties tab click Add and enter the name of the environment variable prefixed by the namespace that you have given to it in the ant script (in my case, the full property name is env.CATALINA_HOME). Assign the appropriate value (e.g. /opt/tomcat5.5.20). Click OK – you’re done.

One Response

  1. Damian Says:

    Same problem for me as well but using Eclipse. Similar resolution (right click Ant task -> External Tools Dialog -> set Property)

    Cheers,

    Damian.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Recent Posts

Highest Rated

Categories

Archives

Meta: