Re: Updates to JPL

[email protected] Fri, 2 Jun 2000 08:39:18 -0400
Newsgroups perl.jpl
Message-ID <[email protected]>
Brain:

I took your suggestion and forwarded our earlier conversations to the JPL
list and have cc: them on this one.  To address your questions, a) I did
add the D:\jdk1.2.2\jre\bin\classic to my %PATH% variable and all is well;
b) the MSVCRT.LIB should be in your %LIBRARY% path -- it's a default MS
thing.  I was wondering if perhaps it was missing from your directory. I
think MSVCRT is the lib with the basic functions and symbols you were
missing in your link.

I found another modification I made to JNI.pm but failed to mention in my
last e-mail:

JNI.PM:226  added     "$ENV{JAVA_HOME}\\jre\\lib\\rt.jar", "\." to the
@CLASSPATH since the JDK 1.2.2 class library seems to have moved from
classes.zip to rt.jar.  At least in the JRE, that is.  I also added "if
$JPL::DEBUG" to all of the print statements to turn off all of the debug
output.  Is there a way to turn jpldebug in JNI.XS OFF or ON
programmatically?

My use of JPL/JNI is beginning slowly.  I receive a "Use of uninitialized
value in scalar dereference at C:/Perl/site/lib/JPL/AutoLoader.pm line
219." warning from Perl every time  the AutoLoader runs.   I looked at this
code but am afraid to touch it -- it looks like real magic to me.  Up to
this point, my code is working so I'm not sure what to think of the Perl
warning.

Are there (i.e., to you have or know the location of) any extensive
examples of using this module?  Particularly, JNI.

Cheers,
Scott.
====================================================
M. Scott Roth,
<[email protected]>
Information Systems Engineer
Science Applications International Corporation
703-375-2260
========================<><=========================



                                                                                                                   
                    Brian Jepson                                                                                   
                    <bjepson@jeps        To:     [email protected]                                          
                    tone.net>            cc:                                                                       
                                         Subject:     Re: Updates to JPL                                           
                    06/01/00                                                                                       
                    10:13 AM                                                                                       
                                                                                                                   
                                                                                                                   





On Thu, 1 Jun 2000 [email protected] wrote:

>
> Hey, Brian, sorry to bother you again.  I have successfully made it past
> the "make test" stage.  I had to make a few modes to JNI.xs and JNI.pm to
> make it JDK 1.2.2-friendly.  I thought I would pass them on.
>
> JNI.pm:233 - changed     $JAVALIB
> = "$ENV{JAVA_HOME}/lib/$arch/$ENV{THREADS_TYPE}";
>           to   $JAVALIB = "$ENV{JAVA_HOME}/lib/";
>      I don't have a "Win32" subdir under $JAVA_HOME/lib and no concept of
> threads, green or otherwise.  In fact, I don't have any subdirs under
> $JAVA_HOME/lib.  This might be a function of only having the win32 JDK
and
> JRE installed instead of a full-blown Java environment.  I don't know how
> this will translate to the ELSE block below it.
>

Thanks - I'll have to look at this - it seems that with every release of
Java, the directory structure gets reorganized...

> JNI.xs:3148 - changed    if (!LoadLibrary("javai".dll")) {
>           to   if (!LoadLibrary("d:
> \\jdk1.2..2\\jre\\bin\\classic\\jvm.dll")) {
>      The JDK and JRE 1.2.2 don't have a javai.dll but the jvm.dll has the
> same functions.  Sun might have discussed the switch in names from JDK
1.1
> to JDK 1.2 but I didn't search through them.  Hard coding the path is not
> elegant and I will fix that now.
>

Great - perhaps we can add a define for JDK 1.1.x vs. JDK 1.2, and let the
preprocessor decide whether we should load javai.dll or jvm.dll.  Could
you add D:\jdk1.2.2\jre\bin\classic to your %PATH%, which would let us
omit the path in the call to LoadLibrary?

> I think those were the only changes.  I hope they help you get this thing
> Perl 5.6 and JDK1.2 compatible.  I have not yet addressed the warnings I
> copied to you on the last message.
>

Thanks - in an earlier mail, you mentioned tacking msvcrt.lib onto the
link stage - did you add this in the Makefile.PL or in the generated
Makefile?  I appreciate the work you're putting into getting this work,
and I'd like to get these changes into the JPL source.

Also, feel free to cc: the jpl list on anything you send me - there may be
lurkers who could come up with useful suggestions to the issues we're
working through (one reason I like cc'ing the list is that Sarathy sees
it).

Cheers,

--
Brian Jepson * ([email protected])  *  http://www.jepstone.net/