I'm running OSX Yosemite
with jdk1.8.0_31
. While I was testing printf
functionality, I realized that I can't run any .class
files in terminal
with command: java MyClass
. Here's the error I get:
Error: Could not find or load main class MyClass.class
Also I can run classes with main
method perfectly fine in Eclipse, and I can compile MyClass.java
with java compiler in terminal by $javac MyClass.java
.
I googled it and asked around, still couldn't find anything.
Any ideas?