Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

OSX Yosemite Ant #32851

Closed
michahell opened this issue Oct 1, 2014 · 17 comments
Closed

OSX Yosemite Ant #32851

michahell opened this issue Oct 1, 2014 · 17 comments

Comments

@michahell
Copy link

Hi,

I am currently running OSX Yosemite beta 4, and this is what my ant installation adventure looks like:
which ant
returns nothing
ant
-bash: ant: command not found
brew install ant
/usr/local/Cellar/ant/1.9.4: 1597 files, 39M, built in 17 seconds
which ant
/usr/local/bin/ant [ o.k., great! ]
ant --execdebug
exec "/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/bin/java" -classpath "/usr/local/Cellar/ant/1.9.4/lib/ant-launcher.jar" -Dant.home="/usr/local/Cellar/ant/1.9.4" -Dant.library.dir="/usr/local/Cellar/ant/1.9.4/lib" org.apache.tools.ant.launch.Launcher -cp ""
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher [ uhh wut ? ]
cd /usr/local/Cellar/ant/1.9.4/ *TAB*
INSTALL_RECEIPT.json
bin/
libexec/

[ so, no /lib folder ]

But, there is a /lib folder in /libexec:
cd /usr/local/Cellar/ant/1.9.4/libexec/lib/

Is this something OSX Yosemite specific? or am i doing something wrong? I never had similar problems when i was on OSX Mavericks :(

[update]

if i execute the following:

"/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/bin/java" -classpath "/usr/local/Cellar/ant/1.9.4/libexec/lib/ant-launcher.jar" -Dant.home="/usr/local/Cellar/ant/1.9.4" -Dant.library.dir="/usr/local/Cellar/ant/1.9.4/lib" org.apache.tools.ant.launch.Launcher -cp ""

then the output becomes:

Buildfile: build.xml does not exist!
Build failed

Which makes sense, because in my root (~/) i don't have any buildfiles. Halp ?

@michahell
Copy link
Author

Hmm, i have installed Ant the good old way and it seems to me that the brew formula for ant is missing the lib directory or at least the folder structure is different to this structure:
http://ant.apache.org/manual/index.html

@jacknagel
Copy link
Contributor

It's installed the way it is (in libexec) because we don't want all of the jar files present linked into /usr/local/lib.

@michahell
Copy link
Author

I don't understand... ant simply does not work then, at least in my case. How can you get it to work then? And could you maybe explain to me why they would be automatically linked into /usr/local/lib ? Does homebrew automagically do this with /lib folders?

@jacknagel
Copy link
Contributor

I'm not denying there is a problem (thought it does work for at least some use cases; several things in homebrew depend on it at build-time).

And could you maybe explain to me why they would be automatically linked into /usr/local/lib ? Does homebrew automagically do this with /lib folders?

Yes. In /usr/local/Cellar/<name>/<version>, files in lib will be linked into the top-level lib. The same goes for bin, sbin, and others.

@michahell
Copy link
Author

Aha, thank you. I can understand that we don't want that. Oh well, i'm fine with going for the 'regular' .pkg installation for ant (i'm using it together with IntelliJ TeamCity, which AFAIK just needs to be able to run ant in your project folder), although it's an addiction to have as many stuff installed by homebrew and homebrew-cask, of course 👍

@jacknagel
Copy link
Contributor

If it doesn't work, there's a bug.

@jacknagel jacknagel reopened this Oct 2, 2014
@michahell
Copy link
Author

oops, too quick!

@jacknagel
Copy link
Contributor

On 10.9, I see this:

$ ant --execdebug
exec "/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/bin/java" -classpath "/usr/local/Cellar/ant/1.9.4/libexec/lib/ant-launcher.jar" -Dant.home="/usr/local/Cellar/ant/1.9.4/libexec" -Dant.library.dir="/usr/local/Cellar/ant/1.9.4/libexec/lib" org.apache.tools.ant.launch.Launcher -cp ""
Buildfile: build.xml does not exist!
Build failed

so it seems to be dereferencing the symlink correctly and looking in libexec/lib.

Can you gist your brew --config and brew doctor?

@jacknagel
Copy link
Contributor

For me it also works on 10.10:

$ uname -a
Darwin vm-mavericks.local 14.0.0 Darwin Kernel Version 14.0.0: Tue Sep 23 23:01:41 PDT 2014; root:xnu-2782.1.97~6/RELEASE_X86_64 x86_64
$ ant --execdebug
exec "/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/bin/java" -classpath "/usr/local/Cellar/ant/1.9.4/libexec/lib/ant-launcher.jar" -Dant.home="/usr/local/Cellar/ant/1.9.4/libexec" -Dant.library.dir="/usr/local/Cellar/ant/1.9.4/libexec/lib" org.apache.tools.ant.launch.Launcher -cp ""
Buildfile: build.xml does not exist!
Build failed

@michahell
Copy link
Author

Ha, that's weird. It must have something to do with my environment then:
brew --config: https://gist.github.com/michahell/c3ae790caaf3da6f7c18
brew doctor: https://gist.github.com/michahell/93bef1ebd3c504ad2ec9
This is without ant being installed through homebrew at the moment though.

@michahell
Copy link
Author

I do run doctor quite regularly but i still needed to clean up some mess created by some scientific robot simulator package i downloaded and tried to compile, sorry for that :)

@DomT4
Copy link
Member

DomT4 commented Oct 4, 2014

What's the status on this? I presume if this is tagged user config it doesn't need adding to the 10.10 fail list?

@jacknagel
Copy link
Contributor

Correct, it does not appear to be a 10.10 issue.

@jacknagel
Copy link
Contributor

I can reproduce this if I set ANT_HOME to /usr/local/Cellar/ant/1.9.4.

That may not be the exact problem here, but I think it is safe to assume this is an environment issue rather than a problem with the formula.

@khawkins
Copy link

So we shouldn't be setting ANT_HOME to homebrew's ant install location? Is the setting of ANT_HOME itself a legacy practice, or is there some other rationale for the setting not to work?

@jacobg
Copy link

jacobg commented Feb 10, 2015

I just ran into this problem. Solution was to just download Ant directly from Apache and copy is to /usr/local

@cloudbring
Copy link

I was having the same issue. I had set my $ANT_HOME according to a guide for Appium testing. Once I unset ANT_HOME it worked without issue. $ANT_HOME as others have said is an outmoded setting.

@Homebrew Homebrew locked and limited conversation to collaborators Aug 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants