cd to right path.
In my case ~/workspace/masa/bin (eclipse workspace)
and
java <package name>.<class file name> (without extension)
e.g
java masa.Rand
(/home/masa/workspace/masa/bin/masa/Rand.class is target file)
or use java -cp . masa/Rand (at ~/workspace/masa/bin )
#package #namespace