w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to execute Linux shell commands on Linux server from a java application that on windows

There is no clear answer and there is a reason for it. The answer depends on the application's requirements. You have two possible solutions which have their pros and cons.

  • Creating a service means that you follow a Service Oriented Architecture. This would be a good choice if your service is going to be used by many clients and you want it to be client agnostic. This is an overkill if you have only one specific client.

  • If you have one specific client which is written to communicate with the specific server you could always use the direct ssh solution. Perhaps a library like Java Secure Channel would the most straight forward solution.

  • A third option would be to use something like RMI (Remote Method Invocation). This is a more complicated solution and I would not suggest it because in my opinion it has no pros.

Hope I helped!





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.