Get my app runing in memory/process and pass a arg.
Hi all,
Anyone knows how to get my app runing in memory if it's runing and pass a argument, how we can do in the comand line:
java -jar myjar.jar arg1 arg2....
Any idea?
Thank's in advance.
Hi all,
Anyone knows how to get my app runing in memory if it's runing and pass a argument, how we can do in the comand line:
java -jar myjar.jar arg1 arg2....
Any idea?
Thank's in advance.
I'm not sure that I understand your question, but I think I do.
This is frequently asked, and you usually solve it by having a server socket in the application, and sending commands to that socket.
Kaj
That is how you would get it running. The arguments are passed in to the main method as an array of Strings
My idea it's an app, that create events on the outlook calendar.
Now in the outlook, the user may to click a link o similar and then open my app if it's not runing or get the instance if is runing and pass a "id" to retrieve from DB information about this event.
do you understand?
the idea of catch my app if is runing is to prevent multiple executions of my app.
thx!!
Ah. Sockets it is, then. Make use of the fact that two sockets cannot listen on the same port on the same machine
> Do you know any reference or example about how to use sockets?
http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
> > Do you know any reference or example about how to
> use sockets?
>
> http://java.sun.com/docs/books/tutorial/networking/
> sockets/index.html
That'll be the one :-)