Subject: | perl Makefile.PL reports "/usr/bin/dlltool: Can't open def file: jvm.def" |
I'm trying to build Inline::Java 0.58 on Cygwin with Perl 5.22.
When I run "perl Makefile.PL" part of the output says:
/usr/bin/dlltool: Can't open def file: jvm.def
Error attempting to create '/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/lib/libjvm.dll.a'
I'm also worried about it saying that it's attempting to write a file to /cygdrive/c/PROGRA~2/Java/jdk1.8.0_112 as that's a protected directory and it won't have permission to write to there (nor should it).
Here is the full output:
mperry@mperry-PC:~/Inline-Java-0.58$ echo $JAVA_HOME
/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112
mperry@mperry-PC:~/Inline-Java-0.58$ perl Makefile.PL
Welcome to the Inline::Java installation procedure.
Using /cygdrive/c/PROGRA~2/Java/jdk1.8.0_112 as J2SDK directory.
Default J2SDK for Inline::Java will be '/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112'.
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.
1) /cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/jre/bin/server
2) /cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/jre/bin/client
Please select from the above list which 'jvm.dll' to use: [2]
Creating '/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/lib/libjvm.dll.a' for cygwin.
/usr/bin/dlltool: Can't open def file: jvm.def
Error attempting to create '/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/lib/libjvm.dll.a'
Building with:
/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/include/jni.h
/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/include/win32/jni_md.h
/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/lib/jvm.lib
/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/jre/bin/client/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:
/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/jre/bin/client
/cygdrive/c/PROGRA~2/Java/jdk1.8.0_112/jre/bin
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]
Warning (mostly harmless): No library found for -ljvm
Generating a Unix-style Makefile
Writing Makefile for Inline::Java::JNI
Writing MYMETA.yml and MYMETA.json
Generating a Unix-style Makefile
Writing Makefile for Inline::Java
Writing MYMETA.yml and MYMETA.json
You can continue the installation with the following commands:
% make
% make test
% make install