Inline Automation :: Installing Java on Linux (Centos / Redhat)

I support a perl script that starts the automatic installation of our core server software. One of the new requirements is the installation of the Inline :: Java module.

Our usual installation strategy using Yum seems to crash because yum does not have Inline :: Java. I can not find the RPM release for it, so I can not install it as an RPM. The only parameters are apparently set via CPAN or send tar and have a step that identifies the location of the SDK and runs perl Makefile.PL J2SDK =; do; make install '.

Instinctively, I think itโ€™s a little difficult for an unattended installation, I had problems with CPAN installations that have not been done in the past, and I really donโ€™t want it on a real server, but I canโ€™t come up with a better option.

Another option I was considering was just to send the .pm file, putting it in a user directory and using "use lib" to determine this as a location, but because of the way Inline :: Java works, I donโ€™t think it maybe he needs an InlineJavaServer location, etc.

Does anyone have a better solution or opinion on which of the above are the best?

+4
source share
2 answers

Inline::Java will look for InlineJavaServer.jar and other files that it needs in the same place as the Inline/Java.pm . Copying the entire distribution kit from the installation directory on one computer and copying it to another computer (with the same architecture) is not as crazy as it seems. If you have only a few different systems (not all Linux, 32 bits and 64 bits, perl 5.6 vs perl 5.10, etc.), you can make a separate package for each system.

Inline::Java has some installation time configuration, including specifying the default Java installation. But this (and other default configurations) can always be overridden by environment variables such as PERL_INLINE_JAVA_J2SDK (see Inline :: Java perldoc for a complete list). You can package Inline::Java with your own module, say MyCompany::InlineJavaConfig , which can set the appropriate environment variables before the Inline::Java module Inline::Java loaded into each script.

There is another setup time configuration there, how to configure JNI and other built-in support. It might be a little harder to copy files that support these features from one machine to another. But I canโ€™t think of any reason that this will not work.

+2
source

You can create your own perl-Inline-Java package and put it in yum's private repository, or even put it in Fedora / EPEL.

+3
source

Source: https://habr.com/ru/post/1301019/


All Articles