File PrintTest.java:
public class PrintTest{ public static void main(String[] args){ System.out.println("Why are you executing me?"); } } File Manifest.txt
Main-Class: PrintTest My command I ran to compress to .jar:
jar cfm PrintTest.jar Manifest.txt PrintTest.class I also tried this (even though it doesn't matter):
jar cmf PrintTest.jar Manifest.txt PrintTest.class My Directory Structure: C:\Program Files\Java\jdk1.6.0_24\PrintTest_jar
PrintTest_jar: PrintTest.java, PrintTest.class, Manifest.txt, PrintTest.jar
When I double-click on the .jar file, nothing happens. No errors, nothing.
PrintTest.class runs fine from the command line. I'm also running on Windows.
java -jar PrintTest.jar