Do you know how to execute a Java program with a class inside a package when the class is NOT packaged in a JAR file? If the class is in a JAR file, it is basically the same, except that you have to make sure the JAR file is included in the classpath. For example, if you have a class named Bar in a package called foo and this class is in a JAR file called foobar.jar, then you execute it as:
This assumes that you are in the same directory as the JAR file. If not, you can specify the complete path for the JAR file after the -cp option.