I am trying to build a java application where i have some java files. it is a project that uses java's networking features(Socket, ServerSocket) . I have a server and some clients . I got two files client.java and server.java who take arguments from the command line.(each has a main(args[] a) method) So i need to to compile and run them individually to test them how they contact with each other. How to get this job done? i mean i would love to see one of my command window is acting as server and another as a client. I am on windows7.
Asked
Active
Viewed 40 times
-1
-
2possible duplicate of [Running Command Line in Java](http://stackoverflow.com/questions/8496494/running-command-line-in-java) – Mar 10 '14 at 14:15
-
How are you compiling them currently? – vandale Mar 10 '14 at 14:19
-
and to naimdjon i don't want to run command line in java i want to compile and run .java from command line. – buet_baba Mar 10 '14 at 14:19
-
i am using netbeans and as far as i found netbeans doesn't support passing command line arguments. – buet_baba Mar 10 '14 at 14:21
-
There is an "Arguments" section under project properties. – C.B. Mar 10 '14 at 14:26
-
@C.B. i used that to make a client name. but if i want to run the whole chat process in command line what should i do? – buet_baba Mar 10 '14 at 14:29
-
@buet_baba Can you just make a "ServerClientDriver.java" file, and instantiate each object and test their communication? Why does it have to be done through command line args? Also, the server should be running as a "daemon" and shouldn't need command line args. – C.B. Mar 10 '14 at 14:37
1 Answers
1
Searching 'run java program' with Google yields answers: (the first result is pretty useful http://www.cs.swarthmore.edu/~newhall/unixhelp/debuggingtips_Java.html).
Running java -h
in the command line yields answers.
If you really don't know how to do these things, you need to read documentation yourself. And if you can't possibly be bothered to read the most basic documentation or search for the most basic of answers, it's not worth our time to spoonfeed them to you. The field of programming requires that you learn to read and research, at least at a basic level.

RustyTheBoyRobot
- 5,891
- 4
- 36
- 55