I developed a client server based java networking Instant Messaging app. The client program is needed to be run on the client computer whereas the server program is on server computer. This works in my local wi-fi network(Home network). But i want this one to deploy on internet using some servers and so,so that my friend who is in another city can run the client program from there. Would it be possible for me to do this? I tried to learn heroku techniques for java but its hard for me to understand.

Yes, it's completely possible.
All you need is to run your server program on a computer that your client can connect to. For example that could be your own computer if you configure your router/firewalls to make it accessible from the web, or you could use a commercial hosting service.

Comments
Well if i host it in a server,then after uploading it to that server how to compile the java program? I mean using the cmd from my laptop? In that way what's the significance of uploading it to the server if finally i am gonna compile it in my laptop's cm

Well if i host it in a server,then after uploading it to that server how to compile the java program? I mean.using the cmd command prompt from my laptop(I am not familiar with IDEs yet)? In that case what's the significance of uploading it to the server if finally i am gonna compile it in my laptop's cmd command prompt? How to execute the program file on server?

You compile the program on your machine and make an executable jar file containing all your compiled classes (and any other resources it needs). You can then execute that jar file on any other machine that has a JRE installed.
See http://docs.oracle.com/javase/tutorial/deployment/jar/index.html

Comments
Yep got it! And what about running(executing) the server program which is needed to be executed on the server? After compiling shouldn't i execute them?

You compile your code, create a jar, copy the jar to the server , then execute it. I'm not sure what your question is.

ps: Please don't reply by adding a comment - I often don't notice them. Make a new post.

Oh..i'll definitely make new posts from now onwards. Well after copying the jar to the server,i go to my command prompt and execute the jar there or where? Basically My question is,how to execute the jar file on server? By double clicking the jar file there on server or by command prompt or how?

This article has been dead for over six months. Start a new discussion instead.