ant-vars.mk in cdbs
  Home FAQ Contact Sign in
linux.debian.maint.java only
 
Advanced search
POPULAR GROUPS

more...

linux.debian.maint.java Profile…
 Up
ant-vars.mk in cdbs         


Author: David Herron
Date: May 21, 2008 07:11

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.

I don't know how to query to find the currently set Java alternative.
update-java-alternatives has --list and --set but not --current. If
that existed maybe JAVA_HOME could be something like:-

JAVA_HOME=/usr/lib/jvm/$(shell update-java-alternatives --current)
Show full article (1.66Kb)
2 Comments
Re: ant-vars.mk in cdbs         


Author: webmaster
Date: May 21, 2008 07:50

David Herron schrieb:
>
> JAVA_HOME=/usr/lib/jvm/$(shell update-java-alternatives --current)

isn't /etc/alternatives/java what you are looking for ?

---
Jens Kapitza

--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
no comments
Re: ant-vars.mk in cdbs         


Author: Michael 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. ...
Show full article (2.16Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Nietzsche var homoseksuel. Beethoven var sort16 dk.politik ·
cvs: phpdoc /en/reference/var/functions var-export.xmlphp.doc ·