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.

[222 byte] By [NewLitusa] at [2007-11-27 11:39:29]
# 1

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

kajbja at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 2

That is how you would get it running. The arguments are passed in to the main method as an array of Strings

georgemca at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 3

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!!

NewLitusa at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 4

Ah. Sockets it is, then. Make use of the fact that two sockets cannot listen on the same port on the same machine

georgemca at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 5

Do you know any reference or example about how to use sockets?

NewLitusa at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 6

The java networking tutorial on this very website

georgemca at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 7

> Do you know any reference or example about how to use sockets?

http://java.sun.com/docs/books/tutorial/networking/sockets/index.html

prometheuzza at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 8

> > 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 :-)

georgemca at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...
# 9

Thank's for everything guys !!!!!

NewLitusa at 2007-7-29 17:26:29 > top of Java-index,Java Essentials,Java Programming...