execute jar file mac code example Example 1: compile java to jar in mac javac HelloWorld.java Example 2: how to run jar file mac java -jar <filename>.jar