how to compile package in java in cmd and run code example Example: compile java code with package in cmd javac –d . demo.java