I looked around, but none of the solutions that worked for others worked for me.
I installed java 1.8.0
My path variable is C:\Program Files\Java\jdk1.8.0_05\bin
I try to run the following program hello.java:
package hello;
public class hello{
public static void main(String[] args){
System.out.println("Hello");
}
}
The program compiles fine when I run javac hello.java
But when I use java hello
, java -cp . hello
, or java -classpath . hello
it returns the error 'Could not find main class hello'.
I know this is a very basic problem, but I really can't figure it out.
Thanks in advance