3

I have a project that builds and works on Windows but when I've brought it over to MacOS (Sierra) and set up Resin, Ant, and the rest of my project in IntelliJ the build is failing with a fairly ambiguous error:

build.xml:24: Directory /java/ant-build/classes creation was not successful for an unknown reason

at org.apache.tools.ant.taskdefs.Mkdir.execute(Mkdir.java:70)

Image of the full error message

At first I thought it was a permissions issue but I ran chmod 755 on the two directories and still am getting this error. I also tried updating to a newer version of Ant to replace IntelliJ's built in one with brew install ant@1.9 but that didn't help either.

Does anyone know of any changes that need to be made to projects when migrating from Windows to Mac? I'm the first one at the company to migrate this project to Mac so unfortunately the others don't know much about this.

Both are using:

  • IntelliJ IDE 2017.1.2
  • Built in IntelliJ Ant (1.9.4)
  • Resin 4.0.51
MLDimitry
  • 121
  • 2
  • 10
  • It's possible that `/java/ant-build/classes` already exists. The `` at line 24 of build.xml cannot create a directory that already exists. Please add line 24 to your question. – Chad Nouis Apr 26 '17 at 13:19
  • Unfortunately not. It doesn't exist. I also tried the opposite and actually created the directory to see if that changed anything and still didn't work. – MLDimitry Apr 26 '17 at 13:23
  • Does `/java` already exist? If so, what is the output of running `ls -ld /java` in a Terminal? – Chad Nouis Apr 26 '17 at 13:26
  • Yes, I should have clarified. `java` exists inside my `/Users/username` folder. `ls -ld java` yields the following results: `drwxr-xr-x 4 username staff 136 26 Apr 09:24 ./java` – MLDimitry Apr 26 '17 at 13:30
  • I mean the `/java` directory under the root directory (notice the slash `/` before `java`). The error message says that Ant attempted to create a directory named `java` under the `/` directory. – Chad Nouis Apr 26 '17 at 13:32
  • Wow I feel dumb! My project is stored in a folder called java and I didn't even think it was pointing to a /java folder in the root directory! So when I was granting permissions, I was granting to the wrong folder. What would you say my best course of action is here to see if this is the issue? Should I create a new directory of /java/ant-build/classes in the root directory and give it permissions? Currently no /java folder exists. – MLDimitry Apr 26 '17 at 13:40
  • I would suggest creating `java/ant-build/classes` under your home directory (`/Users/username/java/ant-build/classes` in your case). Creating the directory under `$HOME` should avoid any problems with permissions. – Chad Nouis Apr 26 '17 at 13:45

1 Answers1

4

As the comments on the main post point out, this was a permissions issue where the ant was trying to build in the root directory

I had to change my build.properties file so the paths were point towards my $HOME directory.

MLDimitry
  • 121
  • 2
  • 10
  • In my case I had `build.properties.default`. I changed the `base.path` to something valid. – Roe Feb 18 '23 at 11:25