Compiling jar on Windows

I’m a Java rookie. I did a basic Java course in college back in the day (even got an A!) but I’m totally clueless now. I finally figured out how to compile into a working jar (running jar out-of-the-box won’t work, appearently you must build with Maven first, I had no idea).

1. Download from github (download zip from master branch directly here)
2. Download Maven
3. Make sure you’ve configured the environmental variable JAVA_HOME (mine is set to C:\Program Files\Java\jdk1.7.0_07) or else Maven will yell error.
4. Add Maven’s bin folder to the environmental variable PATH (or you’ll need to use an absolute path to mvn.exe)
5. Unzip the zip
6. Open commandline and cd to the compiler folder in the unzipped directory. It should contain a src folder and a pom.xml file.
7. Run mvn package
8. The compiler folder should now contain a target folder. The newly built classes is in the classes folder.
9. cd to the classes folder under target.
10. Run jar cf mustache.jar com
11. …
12. Profit. Mustache.jar is now ready

This entry was posted in Java, Maven, Mustache and tagged , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.