I'm having a problem where the 'java' command - no matter what I am trying to run, says that it 'Could not find or load main class'.
Everything is fine when compiling with javac, .class files are created. So when I run:
javac HelloWorld.java
public class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World");
}
}
java HelloWorld
Try using java -cp . HelloWorld
Some good reading: http://www.sergiy.ca/how-to-compile-and-launch-java-code-from-command-line/