So the Java code is permanently running (as some sort of server), and you need to trigger something from the outside? You could open a server socket, which a shell script should be able to connect to via netcat (nc).
RMI requires that not only both client and server apps be Java, but also that they be compatible versions of Java. That's because RMI uses Java Serialization and Java Serialization changes between different Java versions according to no known rules.
You should be less concerned about how to "call a Java Remote Method" than you are about "how to invoke a (remote) service". The real goal is to get something done and/or retrieve information.
These days, probably the most common way to invoke a remote service - possibly even a microservice - is via Web Services. In such a case, the server provides an HTTP API and the client can be written in any language. Data transferred to/from the server is in text form, usually JSON, YAML or SOAP. It's easy for a shell script to invoke web services using curl or wget.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
posted 1 week ago
Thanks for the quick answers
The idea is for a Swing application to be invoked from a script with a string as param ("remote" is so to speak. In fact must be called from same computer) to update one entry of a JTable asynchronously (No returns).
Probably as Tim Holloway said, the most elegant approach is a microservice, but I don't want to need tens of jars to solve this "small" issue.
This is because I thought of JMX or RMI to avoid so many dependencies.
Still recomending me a microservice? Can I run a microservice without Web Server? (sorry for my ignorance)
Anywhere to get a short manual?
Thank you all!!
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book