While there have been many questions related to this, I couldn't find one that specifically answers this.
This is the file structure of my source code in Eclipse. Now I want to run serverStart.java in some machines, and clientStart.java in some other machines.
It has to be compiled and run from command line (CMD) from the source code. I am not allowed to use Eclipse. What command do I use to compile and run the project? Should I create a jar file for this, or use javac? (I tried using javac on clientStart and it gave me some errors (Cannot find symbol), related to other classes like clientData that are in the same package)
Note that clientStart and serverStart have "public static void main(String args[])" and also create objects of other classes like clientACK.java.
This is the folder structure in windows -
EDIT: I also have .class files for each in the bin folder. Are they useful in any way?
解决方案
Answering my own question,
I had to navigate to the parent directory, which is C:\IP\IP_proj2\src in this case. From here, I use the command.
javac IP_proj2/*.java
The key here is to compile them all at the same time using *.java I believe. When I tried it out individually, it gave "cannot find symbol" errors.
Command to run it -
java IP_proj2.serverStart