compile java project from command line with packages code example Example: compile java code with package in cmd javac –d . demo.java