5 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD $JVM @JVM_ARGS $JAVALIB);
11 @ISA = qw(Exporter DynaLoader);
62 CallNonvirtualObjectMethod
63 CallNonvirtualObjectMethodA
64 CallNonvirtualBooleanMethod
65 CallNonvirtualBooleanMethodA
66 CallNonvirtualByteMethod
67 CallNonvirtualByteMethodA
68 CallNonvirtualCharMethod
69 CallNonvirtualCharMethodA
70 CallNonvirtualShortMethod
71 CallNonvirtualShortMethodA
72 CallNonvirtualIntMethod
73 CallNonvirtualIntMethodA
74 CallNonvirtualLongMethod
75 CallNonvirtualLongMethodA
76 CallNonvirtualFloatMethod
77 CallNonvirtualFloatMethodA
78 CallNonvirtualDoubleMethod
79 CallNonvirtualDoubleMethodA
80 CallNonvirtualVoidMethod
81 CallNonvirtualVoidMethodA
102 CallStaticObjectMethod
103 CallStaticObjectMethodA
104 CallStaticBooleanMethod
105 CallStaticBooleanMethodA
107 CallStaticByteMethodA
109 CallStaticCharMethodA
110 CallStaticShortMethod
111 CallStaticShortMethodA
115 CallStaticLongMethodA
116 CallStaticFloatMethod
117 CallStaticFloatMethodA
118 CallStaticDoubleMethod
119 CallStaticDoubleMethodA
121 CallStaticVoidMethodA
124 GetStaticBooleanField
133 SetStaticBooleanField
149 GetObjectArrayElement
150 SetObjectArrayElement
159 GetBooleanArrayElements
162 GetShortArrayElements
165 GetFloatArrayElements
166 GetDoubleArrayElements
167 GetBooleanArrayRegion
175 SetBooleanArrayRegion
193 # This AUTOLOAD is used to 'autoload' constants from the constant()
194 # XS function. If a constant is not found then control is passed
195 # to the AUTOLOAD in AutoLoader.
198 ($constname = $AUTOLOAD) =~ s/.*:://;
199 my $val = constant($constname, @_ ? $_[0] : 0);
201 if ($! =~ /Invalid/ || $!{EINVAL}) {
202 $AutoLoader::AUTOLOAD = $AUTOLOAD;
203 goto &AutoLoader::AUTOLOAD;
206 croak "Your vendor has not defined JNI macro $constname";
209 eval "sub $AUTOLOAD { $val }";
213 bootstrap JNI $VERSION;
215 if (not $JPL::_env_) {
216 $ENV{JAVA_HOME} ||= "/usr/local/java";
218 chop(my $arch = `uname -p`);
219 chop($arch = `uname -m`) unless -d "$ENV{JAVA_HOME}/lib/$arch";
221 my @CLASSPATH = split(/:/, $ENV{CLASSPATH});
222 @CLASSPATH = "." unless @CLASSPATH;
224 "$ENV{JAVA_HOME}/classes",
225 "$ENV{JAVA_HOME}/lib/classes.zip";
226 $ENV{CLASSPATH} = join(':', @CLASSPATH);
228 $ENV{THREADS_TYPE} ||= "green_threads";
230 $JAVALIB = "$ENV{JAVA_HOME}/lib/$arch/$ENV{THREADS_TYPE}";
231 $ENV{$Config{ldlibpthname}} .= ":$JAVALIB";
233 $JVM = GetJavaVM("$JAVALIB/libjava.so",@JVM_ARGS);
241 JNI - Perl encapsulation of the Java Native Interface
249 =head1 Exported constants
262 Copyright 1998, O'Reilly & Associates, Inc.
264 This package may be copied under the same terms as Perl itself.