I’m learning Java and I have a quirk that I think only someone with experience can answer (I have been through the whole list of similar problems on SO).
When running from command line after compiling in Eclipse, this works
java -classpath : test.class
and this does not
java test.class
nor specifying the directory
java -classpath bin test.class
but specifying with a colon DOES
java -classpath bin: test.class
It was my understanding that
- Java checked the current working directory by default
- The colon was only used if you were specifying more than one path where I just have one.
You want to run “java test” not “java test.class”
Cheers