• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Compile and run Java from command line with Eclipse?

skeedo

Senior member
I have a simple client and server program. It's not running properly in console window because it's switching between the two scripts, and I'd like to run it at the command line so it works properly. I can't seem to figure out how to compile and run at command line...???
 
Navigate to the directory where your files are, then use 'javac' to compile and 'java' to execute.

To compile one file (e.g. Client.java): javac Client.java
To compile all java files in that directory: javac *.java

To execute a program (e.g. your main is in the 'Client' class): java Client

You would want to open two terminal windows, one for your server and one for your client.
 
Back
Top