[Open Office] JRE register fails when building 2.0.4 on Mandriva 2007 x86_64

Caolan McNamara caolanm at redhat.com
Thu Oct 26 06:12:31 EDT 2006


On Thu, 2006-10-26 at 12:01 +0200, Atle Nissestad wrote:
> Caolan McNamara wrote:
> 
> >
> > If for some reason we have *no* m_sJavaHome value, we set it to a
> > default of /usr/lib. Depending on what you get as the results above it
> > might be the case that we might need to change... 
> >
> > if (!m_sJavaHome.getLength())
> >     m_sJavaHome = "file:///usr/lib";
> >
> > to
> >
> > if (!m_sJavaHome.getLength())
> > #ifdef X86_64
> >     m_sJavaHome = "file:///usr/lib64";
> > #else
> >     m_sJavaHome = "file:///usr/lib";
> > #endif
> >
> >   
> Yepp, but for me m_sJavaHome was set, so my ugly hack ended up like this:
> 
> #ifndef X86_64
> if (!m_sJavaHome.getLength())
>     m_sJavaHome = "file:///usr/lib";
> #else
>     m_sJavaHome = "file:///usr/lib64";
> #endif
> 
> This apparently caused both /usr/lib and /usr/lib64 to be used as lib
> search path.
> 
> > but then we might fall afoul of gcj's on x86_64 where there isn't a
> > java.home set, but libgcj.so has been put into /usr/lib in which case we
> > might need an additional
> >
> > #ifdef X86_64
> >     if (!bRt)
> >     {
> >         m_sHome = "file:///usr/lib64";
> >         for(i_path ip = libpaths.begin(); ip != libpaths.end(); ip++)
> >         {
> >             //Construct an absolute path to the possible runtime
> >             OUString usRt= m_sHome + *ip;
> >             DirectoryItem item;
> >             if(DirectoryItem::get(usRt, item) == File::E_None)
> >             {
> >                 //found runtime lib
> >                 m_sRuntimeLibrary = usRt;
> >                 bRt = true;
> >                 break;
> >             }
> >         }
> >     }
> > #endif
> >
> > after the existing last 
> > if (!bRt) ...
> >
> >   
> Ok, maybe that's the way to go. Thanks for the explanation (code hacking
> is not my strong side ..).

yeah, maybe it is. If all else fails and we're built for x86_64 give one
final go if m_sHome != "file:///usr/lib64" and try a m_sHome value
of /usr/lib64. 

gcj is sort of in a transition period at the moment I guess, I'd expect
that next iteration of gcj for nearly everyone will move to a standalone
libjvm.so in which case the java.home value becomes reliable to find the
jvm providing library and everyone marches along quite happily. In the
meantime though an additional fallback can't hurt.

There *might* be an argument that mandriva's 64bit gij's java.home
should be /usr/lib64 not /usr/lib (like I bet it says) but
http://gcc.gnu.org/onlinedocs/gcj/GNU-Classpath-Properties.html doesn't
really give any guarantee that it points above the libgcj.so dir, it
probably just so happens to do so for me and a few others.

C.



More information about the Openoffice mailing list