X
41 Rate this article:
No rating

Internal: Configuring IDL to use non-default version of JRE with IDL-Java Bridge on Solaris (Sparc)

Help Article Update 2

Anonym
Topic:
A different release version of Java can by used by the IDL-Java import bridge than is the system default or the one that comes the IDL installation. The version of JRE to be used by the IDL-Java import bridge can be specified by defining the system environment variables:
    LD_LIBRARY_PATH
    IDLJAVAB_LIB_LOCATION

to the directory that contains the required bit-version of "libjvm.so".Discussion:

For example, after installing both 32-bit and then the 64-bit JDK/JRE version 1.6.0_24 on a 64-bit Solaris 10 Sparc system (JRE v1.6.0_16 configured as the system default), the environment in which IDL 8.0.1 (which includes JRE version 1.5.0_22) runs was modified to use newly installed version of the JRE.

The following illustrates the environment configuration described above (tcsh shell used in this example):

(52)% java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)
(53)% cd /usr/local/itt/idl/idl80/idlde/bin.solaris2.sparc/jre/bin
(54)% ./java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode)
(55)% source /usr/local/itt/idl/idl80/bin/idl_setup
(56)% cd /usr/local/itt/idl/idl80/resource/bridges/import/java/examples
(57)% ls ./arraydemo.pro
arraydemo.pro
(58)% setenv LD_LIBRARY_PATH /usr/jdk/jdk1.6.0_24/jre/lib/sparc/server
(59)% setenv IDLJAVAB_LIB_LOCATION /usr/jdk/jdk1.6.0_24/jre/lib/sparc/server
(60)% idl -32
IDL Version 8.0.1, Solaris (sunos sparc m32). (c) 2010, ITT Visual
Information Solutions
Installation number: 99999-1.
Licensed for use by: ITTVIS IDL floating licenses

IDL> arraydemo
% Compiled module: ARRAYDEMO.
array2d short(2,3)= 23 (should be 23)
IDL_SHORT_ARR INT = Array[3, 4]
IDL_Short_arr[2,3]= 23 (should be 23)
array2d short(2,3)= 999 (should be 999)
array2d short(0,0)= 0 (should be 0)
array2d short(1,0)= 1 (should be 1)
array2d short(2,0)= 2 (should be 2)
array2d short(0,1)= 10 (should be 10)
array2d long(0,1)= 10 (should be 10)
IDL> exit
(61)% idl
IDL Version 8.0.1, Solaris (sunos sparc m64). (c) 2010, ITT Visual
Information Solutions
Installation number: 99999-1.
Licensed for use by: ITTVIS IDL floating licenses

IDL> arraydemo
% Compiled module: ARRAYDEMO.
Error loading shared library:
ld.so.1: idl: fatal: /usr/jdk/jdk1.6.0_24/jre/lib/sparc/server/libjvm.so:
wrong ELF class: ELFCLASS32 (Possibly trying to load 32-bit JVM into 64-bit IDL)
% IDL-Java bridge failed to initialize : Failure loading JVM:
/usr/jdk/jdk1.6.0_24/jre/lib/sparc/server/libjvm.so
% Execution halted at: ARRAYDEMO
18 /usr/local/itt/idl/idl80/resource/bridges/import/java/examples/arraydemo.pro
% $MAIN$
IDL> exit
(62)% setenv LD_LIBRARY_PATH /usr/jdk/jdk1.6.0_24/jre/lib/sparcv9/server
(63)% setenv IDLJAVAB_LIB_LOCATION /usr/jdk/jdk1.6.0_24/jre/lib/sparcv9/server
(64)% idl
IDL Version 8.0.1, Solaris (sunos sparc m64). (c) 2010, ITT Visual
Information Solutions
Installation number: 99999-1.
Licensed for use by: ITTVIS IDL floating licenses

IDL> arraydemo
% Compiled module: ARRAYDEMO.
array2d short(2,3)= 23 (should be 23)
IDL_SHORT_ARR INT = Array[3, 4]
IDL_Short_arr[2,3]= 23 (should be 23)
array2d short(2,3)= 999 (should be 999)
array2d short(0,0)= 0 (should be 0)
array2d short(1,0)= 1 (should be 1)
array2d short(2,0)= 2 (should be 2)
array2d short(0,1)= 10 (should be 10)
array2d long(0,1)= 10 (should be 10)
IDL>

 

Solution:
[Edit this field in the IDL-based Tech Tip Editor, v80]