Skip to Main Content

Newbie question about Java, modules/libraries and dependencies.

pmuFeb 2 2018 — edited Feb 4 2018

Foremost apologies for asking a noob question.  I have no experience with Java, but have written some scripts in Perl and Python before (more in Perl than in Python).

The script would SSH into storage devices, gather outputs and email them out to the monitoring/alerting team's email address. While this works fine, here are some issues that are compelling me to look at a different language.

1) Along with Perl, the SSH Module, Email Modules were required to be installed on the servers from which the scripts would run. So, I would write the scripts on my laptop (which has Perl + the required modules installed) and test it. After that, I would need to copy the script to the Server from which it's supposed to run. But just copying the script would not help. I would have to install the modules on the server as well, and many times, due to security reasons, it's not allowed.

2) The script had to be run by a scheduler. I would rather the script get executed once the failure / issue occurs on servers.

Using Java, can I create a single executable, which when copied on to a server will run all by itself, meaning without copying the SSH or Email modules? Ofcourse, I will have to install the required modules for (SSH/Email etc.) along with java and javac on my laptop, but once I do that, write the java program and compile it, can I move the compiled binary on a different server, run it from there and it will run without requiring to install any modules?

Can I do some Event based programming with Java?

Sorry once again for my noobish question.

Regards,

pmu

This post has been answered by unknown-7404 on Feb 2 2018
Jump to Answer
Comments
Post Details
Added on Feb 2 2018
4 comments
306 views