I keep getting errors when I make my .class part of a package and try to run it from cmd.
Here\'s the code that works after using jav
You do not need a -cp flag while running a java class , -cp needed while running a class or a main program from a binary (jar) file. While running a main program from a command line you need to make sure you have the class in the same folder structure as package name in the java file, ex.
home/user/foo java com.test.className
here classNmae class file and exist under home/user/foo/com/test
hope it helps.