February 5th, 2013, 04:22 PM
Join Date: Feb 2013
Time spent in forums: 12 m 53 sec
Reputation Power: 0
The difference in the command line when executing a Java programming
I'm a noob at this Java programming business and first time user of the Shed. Literally just started last night... So here's the story... Last night I was going through the typical HelloWorld Application, simple. Compiled the code with javac in the command land and executed using java HelloWorldApp.class
That was fine, it worked first time.
This evening, i go back to it and use the same line to have a look at it again.. Doesn't work.. I got a "Could not find or load main class HelloWorldApp.class"
From googling the life out of this problem the solution was to type in
java -cp . HelloWorldApp
So, for the love of all that is google - can someone tell me what the difference is? and why was it working the first way last night and not tonight?
Really appreciate your help with this.