> > On Jan 13, 2011, at 9:43 AM, Patrick LeBoutillier < > patrick.leboutill...@gmail.com> wrote: > > > Jay, > > > > I just uploaded 0.53_90 to CPAN, you must use that version for what > > you want to do. There is an example in there: > > > > > http://cpansearch.perl.org/src/PATL/Inline-Java-0.53_90/Java/PerlInterpreter/t/02_perl_interpreter.t > > > > At the end on that file there is a Java program that creates a > > PerlInterpreter, loads a Perl script and calls > > a function in it. I added an example where the Perl code processes a > > ArrayList object (sum_array_list). > > > > The Perl script loaded is here: > > > http://cpansearch.perl.org/src/PATL/Inline-Java-0.53_90/Java/PerlInterpreter/t/Tests.pl > > > > > > Patrick >
Hi Patrick, I looked over the new version and tried to install upon Win7 & Strawberry Perl, unfortunately I can't get JNI to compile on my OS Below is my install log. I'm not sure if I'm missing some environmental variable or something else Thanks Jay c:\> set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_22 cpan> install P/PA/PATL/Inline-Java-0.53_90.tar.gz Database was generated on Tue, 18 Jan 2011 21:35:51 GMT Running make for P/PA/PATL/Inline-Java-0.53_90.tar.gz Checksum for C:\strawberry\cpan\sources\authors\id\P\PA\PATL\Inline-Java-0.53_90 .tar.gz ok Scanning cache C:\strawberry\cpan\build for sizes ............................................................................DONE CPAN.pm: Going to build P/PA/PATL/Inline-Java-0.53_90.tar.gz Welcome to the Inline::Java installation procedure. Using c:\Program Files\Java\jdk1.6.0_22 as J2SDK directory. Default J2SDK for Inline::Java will be 'c:\Program Files\Java\jdk1.6.0_22'. See module documentation for information on how to use a different J2SDK or change this default value. Checking if your kit is complete... Looks good Inline::Java can use a JNI extension that allows the Java Virtual Machine (JVM) to be dynamically linked with Perl instead of running as a separate process. The use of this extension is optional, and building it still allows Inline::Java to run the JVM in the default (separate process) fashion. Note: You need a C compiler to build the extension. Do you wish to build the JNI extension? [y] Building JNI extension. Building with: C:\Program Files\Java\jdk1.6.0_22\include\jni.h C:\Program Files\Java\jdk1.6.0_22\include\win32\jni_md.h C:\Program Files\Java\jdk1.6.0_22\lib\jvm.lib C:\Program Files\Java\jdk1.6.0_22\jre\bin\server\jvm.dll Note: In order for Inline::Java to use the JNI extension, you will need to use the JNI configuration option or set the PERL_INLINE_JAVA_JNI environment variable to a true value. You will also need to add the following directories to your PATH environment variable: C:\Program Files\Java\jdk1.6.0_22\jre\bin C:\Program Files\Java\jdk1.6.0_22\jre\bin\server See README.JNI for more information. The PerlInterpreter extension allows Inline::Java to be loaded directly from Java using an embedded Perl interpreter. It is still EXPERIMENTAL and may not build or work properly on all platforms. See documentation for more details. Do you wish to build the PerlInterpreter extension? [n] y Note (probably harmless): No library found for -ljvm Writing Makefile for Inline::Java::PerlInterpreter Writing Makefile for Inline::Java::JNI Writing Makefile for Inline::Java You can continue the installation with the following commands: % nmake % nmake test % nmake install "C:\Program Files\Java\jdk1.6.0_22\bin\javac.exe" -deprecation -g -d Java\classe s Java\sources\org\perl\inline\java\*.java Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. "C:\Program Files\Java\jdk1.6.0_22\bin\jar.exe" cf Java\InlineJavaServer.jar -C Java\classes org -C Java\classes InlineJava.properties "C:\Program Files\Java\jdk1.6.0_22\bin\jar.exe" cf Java\InlineJavaUser.jar -C Ja va\classes InlineJavaUserClassLink.class dmake.EXE: Warning: -- Found file corresponding to virtual target [java]. cp Java.pm blib\lib\Inline\Java.pm cp Java.pod blib\lib\Inline\Java.pod cp Java\InlineJavaUser.jar blib\lib\Inline\Java\InlineJavaUser.jar cp Java\InlineJavaServer.jar blib\lib\Inline\Java\InlineJavaServer.jar cp sources\org\perl\inline\java/InlineJavaServerThread.java ..\blib\lib\Inline\J ava\sources\org\perl\inline\java\InlineJavaServerThread.java cp default_j2sdk.pl ..\blib\lib\Inline\Java\default_j2sdk.pl cp sources\org\perl\inline\java/InlineJavaPerlInterpreter.java ..\blib\lib\Inlin e\Java\sources\org\perl\inline\java\InlineJavaPerlInterpreter.java cp Protocol.pm ..\blib\lib\Inline\Java\Protocol.pm cp sources\org\perl\inline\java/InlineJavaCallbackQueue.java ..\blib\lib\Inline\ Java\sources\org\perl\inline\java\InlineJavaCallbackQueue.java cp Class.pm ..\blib\lib\Inline\Java\Class.pm cp sources\org\perl\inline\java/InlineJavaThrown.java ..\blib\lib\Inline\Java\so urces\org\perl\inline\java\InlineJavaThrown.java cp sources\org\perl\inline\java/InlineJavaPerlObject.java ..\blib\lib\Inline\Jav a\sources\org\perl\inline\java\InlineJavaPerlObject.java cp sources\org\perl\inline\java/InlineJavaUserClassLink.java ..\blib\lib\Inline\ Java\sources\org\perl\inline\java\InlineJavaUserClassLink.java cp sources\org\perl\inline\java/InlineJavaException.java ..\blib\lib\Inline\Java \sources\org\perl\inline\java\InlineJavaException.java cp sources\org\perl\inline\java/InlineJavaArray.java ..\blib\lib\Inline\Java\sou rces\org\perl\inline\java\InlineJavaArray.java cp sources\org\perl\inline\java/InlineJavaCallback.java ..\blib\lib\Inline\Java\ sources\org\perl\inline\java\InlineJavaCallback.java cp sources\org\perl\inline\java/InlineJavaClass.java ..\blib\lib\Inline\Java\sou rces\org\perl\inline\java\InlineJavaClass.java cp sources\org\perl\inline\java/InlineJavaPerlException.java ..\blib\lib\Inline\ Java\sources\org\perl\inline\java\InlineJavaPerlException.java cp sources\org\perl\inline\java/InlineJavaProtocol.java ..\blib\lib\Inline\Java\ sources\org\perl\inline\java\InlineJavaProtocol.java cp sources\org\perl\inline\java/InlineJavaPerlNatives.java ..\blib\lib\Inline\Ja va\sources\org\perl\inline\java\InlineJavaPerlNatives.java cp Server.pm ..\blib\lib\Inline\Java\Server.pm cp Portable.pm ..\blib\lib\Inline\Java\Portable.pm cp sources\org\perl\inline\java/InlineJavaUserClassLoader.java ..\blib\lib\Inlin e\Java\sources\org\perl\inline\java\InlineJavaUserClassLoader.java cp Array.pm ..\blib\lib\Inline\Java\Array.pm cp sources\org\perl\inline\java/InlineJavaCastException.java ..\blib\lib\Inline\ Java\sources\org\perl\inline\java\InlineJavaCastException.java cp Handle.pm ..\blib\lib\Inline\Java\Handle.pm cp sources\org\perl\inline\java/InlineJavaServer.java ..\blib\lib\Inline\Java\so urces\org\perl\inline\java\InlineJavaServer.java cp sources\org\perl\inline\java/InlineJavaInvocationTargetException.java ..\blib \lib\Inline\Java\sources\org\perl\inline\java\InlineJavaInvocationTargetExceptio n.java cp Callback.pod ..\blib\lib\Inline\Java\Callback.pod cp JVM.pm ..\blib\lib\Inline\Java\JVM.pm cp sources\org\perl\inline\java/InlineJavaPerlCaller.java ..\blib\lib\Inline\Jav a\sources\org\perl\inline\java\InlineJavaPerlCaller.java cp Object.pm ..\blib\lib\Inline\Java\Object.pm cp Callback.pm ..\blib\lib\Inline\Java\Callback.pm cp sources\org\perl\inline\java/InlineJavaHandle.java ..\blib\lib\Inline\Java\so urces\org\perl\inline\java\InlineJavaHandle.java cp sources\org\perl\inline\java/InlineJavaUtils.java ..\blib\lib\Inline\Java\sou rces\org\perl\inline\java\InlineJavaUtils.java cp JNI.pm ..\blib\lib\Inline\Java\JNI.pm cp PerlInterpreter.pm ..\..\blib\lib\Inline\Java\PerlInterpreter.pm cp PerlInterpreter.pod ..\..\blib\lib\Inline\Java\PerlInterpreter.pod C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp -typemap C:\strawberry\perl\lib\ExtUtils\typemap PerlInterpreter.xs > PerlInterpreter.x sc && C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- PerlInterpr eter.xsc PerlInterpreter.c gcc -c "-IC:\Program Files\Java\jdk1.6.0_22\include" "-IC:\Program Files\Java\j dk1.6.0_22\include\win32" -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSE RVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-st rict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -I"C:\strawberry\perl\lib\CO RE" -DPERL_PARSE_DUP_ENV -s -O2 -DVERSION=\"0.52\" -DXS_VERSION=\"0 .52\" "-IC:\strawberry\perl\lib\CORE" PerlInterpreter.c Running Mkbootstrap for Inline::Java::PerlInterpreter () C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 PerlInterp reter.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Inline::Java::PerlInterpreter\", 'DLBASE' => 'Perl Interpreter', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def PerlInterpreter.def --output-exp dll.exp g++ -o ..\..\blib\arch\auto\Inline\Java\PerlInterpreter\PerlInterpreter.dll -Wl, --base-file -Wl,dll.base -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\l ib" C:\strawberry\perl\lib\CORE\libperl512.a C:\strawberry\c\x86_64-w64-mingw32 \lib\libmoldname.a C:\strawberry\c\x86_64-w64-mingw32\lib\libkernel32.a C:\straw berry\c\x86_64-w64-mingw32\lib\libuser32.a C:\strawberry\c\x86_64-w64-mingw32\li b\libgdi32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libwinspool.a C:\strawberry\ c\x86_64-w64-mingw32\lib\libcomdlg32.a C:\strawberry\c\x86_64-w64-mingw32\lib\li badvapi32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libshell32.a C:\strawberry\c\ x86_64-w64-mingw32\lib\libole32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libolea ut32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libnetapi32.a C:\strawberry\c\x86_ 64-w64-mingw32\lib\libuuid.a C:\strawberry\c\x86_64-w64-mingw32\lib\libws2_32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libmpr.a C:\strawberry\c\x86_64-w64-mingw 32\lib\libwinmm.a C:\strawberry\c\x86_64-w64-mingw32\lib\libversion.a C:\strawbe rry\c\x86_64-w64-mingw32\lib\libodbc32.a C:\strawberry\c\x86_64-w64-mingw32\lib\ libodbccp32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libcomctl32.a -mdll -s -L" C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" PerlInterpreter.o -Wl,--ima ge-base,0x190b0000 C:\strawberry\perl\lib\CORE\libperl512.a -lmoldname -lkernel 32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut3 2 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomct l32 dll.exp dlltool --def PerlInterpreter.def --base-file dll.base --output-exp dll.exp g++ -o ..\..\blib\arch\auto\Inline\Java\PerlInterpreter\PerlInterpreter.dll -s - L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" C:\strawberry\perl\lib\C ORE\libperl512.a C:\strawberry\c\x86_64-w64-mingw32\lib\libmoldname.a C:\strawbe rry\c\x86_64-w64-mingw32\lib\libkernel32.a C:\strawberry\c\x86_64-w64-mingw32\li b\libuser32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libgdi32.a C:\strawberry\c\ x86_64-w64-mingw32\lib\libwinspool.a C:\strawberry\c\x86_64-w64-mingw32\lib\libc omdlg32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libadvapi32.a C:\strawberry\c\x 86_64-w64-mingw32\lib\libshell32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libole 32.a C:\strawberry\c\x86_64-w64-mingw32\lib\liboleaut32.a C:\strawberry\c\x86_64 -w64-mingw32\lib\libnetapi32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libuuid.a C:\strawberry\c\x86_64-w64-mingw32\lib\libws2_32.a C:\strawberry\c\x86_64-w64-mi ngw32\lib\libmpr.a C:\strawberry\c\x86_64-w64-mingw32\lib\libwinmm.a C:\strawber ry\c\x86_64-w64-mingw32\lib\libversion.a C:\strawberry\c\x86_64-w64-mingw32\lib\ libodbc32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libodbccp32.a C:\strawberry\c \x86_64-w64-mingw32\lib\libcomctl32.a -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" PerlInterpreter.o -Wl,--image-base,0x190b0000 C:\strawb erry\perl\lib\CORE\libperl512.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspoo l -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 ..\..\blib \arch\auto\Inline\Java\PerlInterpreter\PerlInterpreter.dll C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- PerlInterpreter.b s ..\..\blib\arch\auto\Inline\Java\PerlInterpreter\PerlInterpreter.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 ..\..\blib \arch\auto\Inline\Java\PerlInterpreter\PerlInterpreter.bs C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp -typemap C:\strawberry\perl\lib\ExtUtils\typemap -typemap typemap JNI.xs > JNI.xsc && C :\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- JNI.xsc JNI.c gcc -c "-IC:\Program Files\Java\jdk1.6.0_22\include" "-IC:\Program Files\Java\j dk1.6.0_22\include\win32" -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSE RVATIVE -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-str ict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0. 53_90\" -DXS_VERSION=\"0.53_90\" "-IC:\strawberry\perl\lib\CORE" JNI. c Running Mkbootstrap for Inline::Java::JNI () C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 JNI.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Inline::Java::JNI\", 'DLBASE' => 'JNI', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def JNI.def --output-exp dll.exp g++ -o ..\blib\arch\auto\Inline\Java\JNI\JNI.dll -Wl,--base-file -Wl,dll.base -m dll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" JNI.o -Wl,--image -base,0x2e220000 C:\strawberry\perl\lib\CORE\libperl512.a C:\strawberry\c\x86_6 4-w64-mingw32\lib\libmoldname.a C:\strawberry\c\x86_64-w64-mingw32\lib\libkernel 32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libuser32.a C:\strawberry\c\x86_64-w 64-mingw32\lib\libgdi32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libwinspool.a C :\strawberry\c\x86_64-w64-mingw32\lib\libcomdlg32.a C:\strawberry\c\x86_64-w64-m ingw32\lib\libadvapi32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libshell32.a C:\ strawberry\c\x86_64-w64-mingw32\lib\libole32.a C:\strawberry\c\x86_64-w64-mingw3 2\lib\liboleaut32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libnetapi32.a C:\stra wberry\c\x86_64-w64-mingw32\lib\libuuid.a C:\strawberry\c\x86_64-w64-mingw32\lib \libws2_32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libmpr.a C:\strawberry\c\x86 _64-w64-mingw32\lib\libwinmm.a C:\strawberry\c\x86_64-w64-mingw32\lib\libversion .a C:\strawberry\c\x86_64-w64-mingw32\lib\libodbc32.a C:\strawberry\c\x86_64-w64 -mingw32\lib\libodbccp32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libcomctl32.a dll.exp JNI.o:JNI.c:(.text+0x1294): undefined reference to `_imp__JNI_GetCreatedJavaVMs' JNI.o:JNI.c:(.text+0x1305): undefined reference to `_imp__JNI_CreateJavaVM' collect2: ld returned 1 exit status dmake: Error code 129, while making '..\blib\arch\auto\Inline\Java\JNI\JNI.dll' dmake.EXE: Error code 255, while making 'subdirs' PATL/Inline-Java-0.53_90.tar.gz C:\strawberry\c\bin\dmake.EXE -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: PATL/Inline-Java-0.53_90.tar.gz : make NO