After installing Remote Java module, Lordui will handle as Remote Java server. There can be only one server running on the single operation system. Any next Server will not start (the application will simply start without the Remote Java server). The server uses Java RMI mechanism on Port 7231.
Any Java application will be connected as a client. To connect Java application you have to perform two steps (where the first step is not always necessery - see next steps).
- add Remote Java Client jar to the classpath,
- start the client.
To have the client included in Remote Java application classpath, please download it from www.lordui.com site. There are two recommended ways of including the client jar in classpath:
- adding it into application classpath like an additional library,
- adding it to virtual machine classpath, so every Java Application will have the client Jar file loaded.
When having Remote Java client code loaded into Application, the last step is to start the client, so it will connect to the server. There are two ways of doing that. First one is just to include command:LorduiRMIClient.execute();
directly in your code.
The second one is more tricky, but doesn't need first step to be performed. We will run the client, that will start the connection and execute the Application after that. The format is to run all the jars (including Remote Java client) in classpath, starting with class:
modules.ktm.autoclicker.remoteJava.client.JavaRemoteClient
The arguments will be: ''mainclass'', ''name.of.your.applications.class'', ''arguments...'' As an example, let's assume we have got the application that we execute using command like: java -jar myapp.jar ''arg1''. From myapp.jar, looking into the manifest file, we know, that the application start with the com.application.Main class to run the main(String[]) method. Let's start the application. The command could be eg:
java -cp "my_app.jar;RemoteJavaClient.jar"
modules.ktm.autoclicker.remoteJava.client.JavaRemoteClient
main_class com.application.Main arg1
. This command will start Remote Java Client and execute the Java application just like user would do that normally. The
tray icon will inform you, that the client has started.
krzys
2017-07-19