Subject: Re: sun-jdk15 and wireless toolkit v2.2
To: Brian de Alwis <bsd@cs.ubc.ca>
From: stefanos mparas <stefano@arx.net>
List: netbsd-users
Date: 06/21/2007 11:58:47
Brian de Alwis wrote:
> On 2007.06.20 15:08:59 -0600, Brian de Alwis wrote:
>   
>> So I suspect this problem has something to do with the directory
>> layout resulting from installing sun-jdk15/sun-jre15.
>>     
>
> Looking into this further, the problem is indeed caused by conflicts
> in assumptions in the layouts by the WTK's compilation code.
>
>   * The WTK code assumes that the System property "java.home"
>     points to a JRE directory contained within a JDK directory,
>     and replaces the last with "/lib/tools.jar".  This is true
>     for the pkgsrc-wip/jdk15 package and a manually installed
>     Linux JDK; it is not true for lang/sun-j{re,dk}15.
>     (See com.sun.kvem.ktools.ToolLoader defined in ktools.zip)
>
>   * The JVM computes "java.home" by finding the path to libjvm.so
>     and lopping off the last four '/'-delimited components.
>     Unfortunately the sun-jre15 package installs the libjvm.so in
>     /usr/pkg/java/sun-1.5/lib/<arch>/<vmtype>/libjvm.so.
>     So java.home=/usr/pkg/java/sun-1.5, and hence why lib/tools.jar
>     isn't found.
>
> The solution is for sun-jre15 to preserve the layout of the JRE
> when installing: replacing the jre directory with a symlink no
> longer works.  It's ugly, but unfortunately seems to have become
> necessary.
>
> Brian.
>
>   
i have only installed lang/sun-jdk15 ( it depends on lang/sun-jre15 )
and the WTK (linux binary),
jre is symlinked to :

"Jun 19 16:09 /usr/pkg/java/sun-1.5/jre -> ."

based on your remarks , doing just a :

"ln -s /usr/pkg/java/sun-1.5/lib /usr/pkg/java/lib"

its enough for me to build ( compile , preverify , package ) 
successfully now
 
i wonder if this behavior ( filesystem layout , emulation , java-linux )
is "stable" enough so as to have patches for package sun-j2me to install ,
( or on the other hand set a pkg_fail_reason if it detects a non-native 
java install )

thanks for your help ,

stefano