how to create a jar file in macbook 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