Author: Michael KochMichael Koch Date: May 21, 2008 13:10
On Wed, May 21, 2008 at 03:59:59PM +0200, David Herron wrote:
> Hi, I'm looking at learning to package java apps for Ubuntu/Debian and
> came across the cdbs thingy
>
> In there is ant.mk and ant-vars.mk and in the latter is this stanza:-
>
> JAVA_HOME = $(shell for jh in $(JAVA_HOME_DIRS); do if [ -x
> "$$jh/bin/java" ]; then \
> echo $${jh}; exit 0; fi; done)
> JAVACMD = $(JAVA_HOME)/bin/java
>
> Clearly the issue is to, at compile time, find where JAVA_HOME is so
> that...? But is this the best way to find JAVA_HOME and what about the
> Java alternatives? The above code is going to stop at the first
> /usr/lib/jvm/*/bin/java it finds and depending on the sort order of '*'
> it might or might not be the best or desired choice on a system that has
> several Java implementations installed.
>
> The way Java implementations are installed a /usr/bin/java and
> /usr/bin/javac exist. But ant requires knowing where JAVA_HOME is. ...
|