I don't know why I can't run compiled java class. Even very simple. Please see below.
C:\javatest>echo %CLASSPATH%
C:\Program Files\Java\jdk1.7.0_45\bin; C:\Program Files\Java\jdk1.7.0_45\jre\bin
C:\javatest>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.7.0_45
C:\javatest>cat hello.java
class hello{
public static void main(String[] agrs){
System.out.println("Hello world");
}
}
C:\javatest>javac hello.java
C:\javatest>java hello.class
Error: Could not find or load main class hello.class
C:\javatest>java -cp . hello.class
Error: Could not find or load main class hello.class
C:\javatest>
JAVA in windows path C:\Program Files\Java\jdk1.7.0_45\bin
Please help.
EDITED
C:\javatest>java hello
Error: Could not find or load main class hello
C:\javatest>java.exe hello
Error: Could not find or load main class hello
javac -versionandjava -version?