Hi all,
I wrote a simple Java program "HelloWorld". When I try to run it I am getting message in console as "The java class is not found:".. but the program compiles fine. Any specific reasons for this?
Printable View
Hi all,
I wrote a simple Java program "HelloWorld". When I try to run it I am getting message in console as "The java class is not found:".. but the program compiles fine. Any specific reasons for this?
Karthika,
Make sure that the compiler can see your .class file thats generated after the compilation of your java program.
Or you can use the -classpath or -cp option while running your java program and provide the path where your .class file reside.
Refer here : Java Command Line
Hope that helps,
Goldest
is your classpath set to go somewhere else?
also, look in the current dir of the file and use dir, is there a .class file?
Finally, when you use java it is case sensitive.
If you have your classpath set to some other location you can use the following
Code:java -cp classpath classname