If you either open the jar file with a zip utility or run jar xf foo.jar you can extract the files from it, and have a look at them. Note that you don't need a jar file to run Java code - classloaders can load class data directly from the file system, or from URLs, as well as from jar files.
java - What exactly does a jar file contain? - Stack Overflow
A JAR file is nothing but a ZIP file with added meta-information for the Java Runtime Environment. So the easiest way is to actually zip your classes files including that META-INF folder by hand, then rename the file to JAR. How you get your classes files however is a different story.
java - The simplest way to create a jar file? - Stack Overflow
Follow this answer, if you've got a jar file, and you need to run it See troubleshooting sections for hints to solve most common errors Introduction There are several ways to run java application: java -jar myjar.jar - is the default option to run application java -cp my-class-path my-main-class or java -classpath my-class-path my-main-class java --module-path my-module-path --module my-module ...
I have a JAR file named helloworld.jar. In order to run it, I'm executing the following command in a command-line window: java -jar helloworld.jar This works fine, but how do I execute it with dou...
I am trying to extract the files from a .jar file. How do I do that using command line? I am running Windows 7
What would be the easiest way to view classes, methods, properties, etc. inside a jar file? I'm looking for something equivalent to the very useful Lutz Roeder .NET Reflector - for Java