Reputation: 374
I've read through the other questions and have tried googling the solutions, but I couldn't find the solution I was looking for.
This program compiles and runs on NetBeans, but only complies on CMD. I WANT to get it running with CMD.
I'm not very good with Java - just starting out and this is a uni project.
Upvotes: 0
Views: 1399
Reputation: 1082
First of all return back to your program directory
cd..
Now simply give the command
java Program
Upvotes: 0
Reputation: 201429
The program is in a package chess
. Move up a folder,
C:\Users\Nihir\Documents\chess> cd ..\
C:\Users\Nihir\Documents> java -cp . chess.Program
Upvotes: 2
Reputation:
You have to use fully qualified names to invoke a class from the commandline. which would be "chess.Program" instead of "Program"
Upvotes: 1