JBoss ports do not respect the user's JAVA_VERSION

Panagiotis Astithas past at ebs.gr
Thu Sep 29 06:52:31 PDT 2005


Herve Quiroz wrote:
> On Thu, Sep 29, 2005 at 12:18:29PM +0100, Ashley Moran wrote:
> 
>>Panagiotis Astithas wrote:
>>
>>>Actually grepping through the java category shows that almost all 
>>>java-dependent ports, behave like that. Shouldn't we make a sweep and 
>>>fix them all?
> 
> 
> Actually that's indeed the intended behavior. The port defines a *range*
> of JVM versions that are acceptable and one is picked up during
> build/install of the port. Hence the "+" in "1.4+" to allow other JDKs
> to be picked up.
> 
> Your problem here lies in the fact that you have several JDKs installed
> and that they are not sorted the way you would like them to be. Here
> again it's the intended behavior. There is an "official" priority list
> for JDK ports in bsd.java.mk and java/jdk14 is the default JDK on any
> FreeBSD but 4.x. However, users may override this order, using
> JAVA_PREFERRED_PORTS (in /etc/make.conf for instance).
> 
> 
>>I had a similar problem.  I had to hack my /usr/ports/Mk/bsd.java.mk 
>>file to set the preferred JDK to native/1.5 to get tomcat to compile 
>>against JDK 1.5.  I was wondering when this file will be updated to 
>>support the latest JDK (even if native/1.4 is left as the default).
> 
> 
> No need to hack your bsd.java.mk, just add this in your /etc/make.conf:
> 
> JAVA_PREFERRED_PORTS=	JAVA_PORT_NATIVE_BSDJAVA_JDK_1_5
> 
> I've been updating lots of Java ports recently to have them use
> javavmwrapper 2.0 (which uses the logic from bsd.java.mk) so that no
> JAVA_HOME is hardcoded anymore. But you are right the JBoss ports (and
> jboss*ctl executables) do hardcode some JAVA_HOME value. Once the
> rcNG'ification of www/jakarta-tomcat55 is proven to be fine (through
> testing and feedback), I will try to apply the same changes to the JBoss
> ports as well.
> 
> OTOH, the main issue here is more about documenting the
> JAVA_PREFERRED_PORTS feature. In this extend, I am trying to write down
> a "FreeBSD Java Handbook" based on the work in "Java and Jakarta Tomcat
> on FreeBSD" article [1].  But my spare time is quite limited at the
> moment so it may take quite a long time for me to come up with the final
> article. However, I will try to add a small statement in the header of
> bsd.java.mk about it ASAP.
> 
> Herve

Ah, I see. My initial reaction was to check the man page of 
javavmwrapper and I didn't see a mention of JAVA_PREFERRED_PORTS in 
there. If you could add a couple of lines about its use, then we'd be 
fine I think. I very much appreciate the fact that javavmwrapper and 
bsd.java.mk are consistent in their selection of jdks.

Thanks,

Panagiotis


More information about the freebsd-java mailing list