|
From: Leif M. <le...@ta...> - 2006-05-17 02:02:52
|
Richard,
The wrapper binary itself can always be 32 bit. It is an
independent process and
the 32-bit version works fine on 64-bit platforms. the libwrapper.so
file is another
story. 3.2.0 supports platform specific naming. If you download the
delta pack
release, you will find that it contains all of the currently supported
platforms in a
single release. The files have been named in such a way as to make
sure the
correct wrapper binary and libwrapper.so file are used for the current
platform
and JVM.
In the case of a 32-bit linux JVM, libwrapper-linux-x86-32.so will
be loaded.
64-bit would be libwrapper-linux-x86-84.so. The WrapperManager class takes
care of this by trying to first load a platform specific JNI library and
then falling back
to the default libwrapper.so name.
This method works great for the wrapper's JNI library. But most
java classes do
not contain support for attempting to load platform specific native
libraries based on
their names.
To work around this, 3.2.1 will contain a series of 3 new
environment variables
that will be set on wrapper invocation and be available within the
wrapper.conf file:
wrapper.java.library.path.1=../lib/%WRAPPER_OS%-%WRAPPER_ARCH%-%WRAPPER_BITS%
This makes it possible to create a library path as follows so that
each platform
specific directory contains the native libraries for that platform.
This method will
work with any java class requiring a native library without requiring
any code
modifications.
Cheers,
Leif
Richard Emberson wrote:
> Leif,
>
> The native libraries are one of the issues. On a 64 bit machine if
> I install the 64 bit wrapper and libwrapper.so can I run a 32 bit
> jvm or must I run a 64 bit jvm?
> Thanks.
>
> Richard
>
>
> Leif Mortenson wrote:
>> Richard,
>> Oh. To do that you are going to need to use Runtime.exec to
>> run "uname -a" or some variant. Note that if you are worried about
>> native libraries within Java though, it is the bit depth of the JVM, not
>> that of the hardware that is going to matter to you.
>>
>> Cheers,
>> Leif
>>
>> Richard Emberson wrote:
>>> On my 64 linux workstation when I run java 1.4.2_11,
>>> a 32 bit version of Java, sun.arch.data.model == 32;
>>> but when I run java 1.5.0_06 amd64, a 64 bit version
>>> of Java, sun.arch.data.model == 64.
>>> I was not clear. I wish to know the underlying
>>> hardware machine bits, 32 or 64, if possible from
>>> within java.
>>>
>>> Richard
>>>
>>> Leif Mortenson wrote:
>>>> Richard,
>>>> Download the source distribution and take a look at the
>>>> build.xml in the root
>>>> directory. It does exactly this. If you want to see an example
>>>> of it being done
>>>> in Java, then take a look at the source of the WrapperManager class
>>>> in the
>>>> generateDetailedNativeLibraryBaseName method. The JVM bits are
>>>> accessed
>>>> as follows:
>>>> m_jvmBits = Integer.getInteger( "sun.arch.data.model", -1
>>>> ).intValue();
>>>> Note that the property does not exist on all JVMs.
>>>>
>>>> Cheers,
>>>> Leif
>>>>
>>>> Richard Emberson wrote:
>>>>> I have to support solaris, linux and windows on
>>>>> 32 and 64 bit machines.
>>>>> The wrapper executable and native library comes in
>>>>> 32 and 64 bit versions for those OSs.
>>>>> What I need is the ability during an installation
>>>>> to know what the machine (the hardware) architecture
>>>>> is, 32 or 64 bit. I need to be able to know this
>>>>> from within a java process (actually an Ant task).
>>>>> I discovered today on my 64 bit workstation that if
>>>>> I run java 1.4.x, a 32 bit java, then the system
>>>>> property os.arch has the value i386 but if I run java
>>>>> 1.5.x the os.arch has the value amd64 --- os.arch
>>>>> does not give the hardware architecture but rather
>>>>> the java vm architecture. In order to install the
>>>>> correct version of the wrapper executable and
>>>>> native libaray I need the true hardware architecture
>>>>> independent of what jvm I will be running.
>>>>> Any thoughts as to how to get this information
>>>>> using just java?
>>>>>
>>>>> Richard
>>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------
>>>> Using Tomcat but need to do more? Need to support web services,
>>>> security?
>>>> Get stuff done quickly with pre-integrated technology to make your
>>>> job easier
>>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>>>> Geronimo
>>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>>
>>>> _______________________________________________
>>>> Wrapper-user mailing list
>>>> Wra...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>>>>
>>>
>>>
>>
>>
>>
>> -------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services,
>> security?
>> Get stuff done quickly with pre-integrated technology to make your
>> job easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Wrapper-user mailing list
>> Wra...@li...
>> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>>
>
>
|