Sublime Forum

Maybe a stupid question...ST3 on Mac, about building

#1

always say that “NO SUCH FILE OR DIRECTORY : ‘ANT’”

how can i solve this ? i even cant run hello world

0 Likes

#2

Sublime ships with two different methods for building Java code, one that uses Ant and one that just compiles your single java file with JavaC. If it’s trying to run Ant, either you specifically chose that build system, or you have an Ant build.xml file in your project that Sublime is detecting that makes it automatically select Ant as the build method.

It’s failing because either you do not have Ant installed, or you do but it is not contained in /usr/bin, /bin, /usr/sbin or /sbin (the path that is displayed in your error message).

So, if you don’t already have Ant installed, you need to install it first. If you do have Ant installed, you need to do one of the following:

  • Put a link to it in one of the locations that Sublime is currently trying to search
  • Add the location that Ant is installed in (technically it’s bin directory) to your path and then (as you are using a Mac) install the Fix Mac Path plugin so that Sublime can see it
  • Create your own build system modeled on the default Ant build but which specifies the path to ant.
1 Like