I have made program in java using netbeans. it is located in d:\sudhanshu\documents\netbeansprojects\Firstapp\src\firstapp. its name is First.java. it is running successfully and showing output in netbeans IDE. but when i m trying to run it through cmd its showing the above error.
PATH is set to c:\program files\java\jdk1.7.0_07\bin
classpath is set to .
i have also tried setting classpath to c:\program files\java\jdk1.7.0_07\bin but there was no change in the error..
javac First.java is running and CLASS file is getting created in the same folder where the program is.
please help me out.. i cannot debug it..
– If you are able to create a .class file then i think you have successfully installed your Java
Tip:
Always do a
java -versionon the command prompt, and if it returns with the version of JDK installed on your system, then you have successfully installed your Java.– Now i will advice you to do this from the same directory where you class file is located to execute the file.
java First