简体   繁体   English

在运行Strawberry Perl的Windows上安装Inline :: Java的问题

[英]Issues with Installing Inline::Java on Windows running Strawberry Perl

I am trying to install Inline::Java on Windows 10 machine, running ActivePerl. 我正在尝试在运行ActivePerl的Windows 10计算机上安装Inline::Java since cpan -i Inline::Java did not work, I downloaded the module, and tried to do the installation: 由于cpan -i Inline::Java不起作用,我下载了该模块,并尝试进行安装:

perl MakeFile.PL
gmake
gmake test
gmake install

Welcome to the Inline::Java installation procedure.

Using C:\Program Files\Java\jdk1.8.0_131 as J2SDK directory.

Default J2SDK for Inline::Java will be 'C:\Program Files\Java\jdk1.8.0_131'.
See module documentation for information on how to use a different J2SDK
or change this default value.

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] y

Building JNI extension.

Building with:
  C:\Program Files\Java\jdk1.8.0_131\include\jni.h
  C:\Program Files\Java\jdk1.8.0_131\include\win32\jni_md.h
  C:\Program Files\Java\jdk1.8.0_131\lib\jvm.lib
  C:\Program Files\Java\jdk1.8.0_131\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.8.0_131\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] n

Writing MYMETA.yml and MYMETA.json
Generating a gmake-style Makefile
Writing Makefile for Inline::Java
Writing MYMETA.yml and MYMETA.json

You can continue the installation with the following commands:
  % nmake
  % nmake test
  % nmake install

C:\Users\msrivastava\Downloads\Inline-Java-0.53>gmake
"C:\Program Files\Java\jdk1.8.0_131\bin\javac.exe" -deprecation -g -d Java\classes Java\sources\org\perl\inline\java\*.java
javac: file not found: Java\sources\org\perl\inline\java*.java
Usage: javac <options> <source files>
use -help for a list of possible options
gmake: *** [Makefile:981: java.ts] Error 2

C:\Users\msrivastava\Downloads\Inline-Java-0.53>gmake test
"C:\Program Files\Java\jdk1.8.0_131\bin\javac.exe" -deprecation -g -d Java\classes Java\sources\org\perl\inline\java\*.java
javac: file not found: Java\sources\org\perl\inline\java*.java
Usage: javac <options> <source files>
use -help for a list of possible options
gmake: *** [Makefile:981: java.ts] Error 2

C:\Users\msrivastava\Downloads\Inline-Java-0.53>gmake install
"C:\Program Files\Java\jdk1.8.0_131\bin\javac.exe" -deprecation -g -d Java\classes Java\sources\org\perl\inline\java\*.java
javac: file not found: Java\sources\org\perl\inline\java*.java
Usage: javac <options> <source files>
use -help for a list of possible options
gmake: *** [Makefile:981: java.ts] Error 2

Has anybody faced a similar issue or successfully installed Inline::Java on Windows with Strawberry Perl? 有没有人遇到类似的问题或在Windows上使用Strawberry Perl成功安装了Inline::Java

This procedure worked for installation on windows 7: 此过程适用于在Windows 7上进行安装:

  1. JDK Java Development Kit version 7 is installed 已安装JDK Java Development Kit版本7
  2. JAVA_HOME variable is in PATH JAVA_HOME变量位于PATH中
  3. install Inline, Inline::C 安装内联,内联:: C
  4. install Inline::Java 0.58 from a tar file, not from cpan 从tar文件而不是cpan安装Inline :: Java 0.58
  5. from an untared folder: perl Makefile.PL J2SDK="c:\\path\\to\\java_home" (JNI option no) 从未压缩的文件夹中:perl Makefile.PL J2SDK =“ c:\\ path \\ to \\ java_home”(JNI选项否)
  6. dmake, dmake test, dmake install dmake,dmake测试,dmake安装

Other procedures may work too. 其他过程也可能起作用。

The problem was with the source code of the Makefile & MakeFile.PL changed path at line 8 in MakeFile.PL & changed path in MakeFile at java.ts section at line 93. I had to insert 1 more slash where the path was given and it worked. 问题在于Makefile和MakeFile.PL的源代码在MakeFile.PL的第8行更改了路径,并在93行的java.ts部分的MakeFile更改了路径。我不得不在给出路径的位置再插入1个斜杠,有效。 Also, don't run make test. 另外,请勿运行make测试。 directly make install. 直接进行安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM