I built a package called "com.hello" in eclipse and I wrote an easy HelloWorld program. Eclipse automatically added "package com.hello;" on top of my program. And HelloWorld.java was put in
F:\workspace\helloWorld\src\com\hello;
HelloWorld.class was put in
F:\workspace\helloWorld\bin\com\hello.
It worked very well in Eclipse. But when I entered the directory "F:\workspace\helloWorld\bin\com\hello
" and used command line with "java HelloWorld," I got NoClassDefFoundError
. I know it may have something to do with the classpath. But I'm not quite sure.