Using a build tool like Maven or Gradle is the most maintainable and professional way.
There are many way of shortcut for personal rnd and uses using CMD command prompt:
javac MyApp.java // Compile
java MyApp // Run
java -jar myApp.jar // Run a JAR file
javac -d out src\my\pkg\*.java // Compile to specific folder
OR
jar cfe MyApp.jar my.pkg.MainClass -C out .