Skip to content

Instantly share code, notes, and snippets.

@quark-zju
Last active July 15, 2020 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save quark-zju/4436855 to your computer and use it in GitHub Desktop.
Save quark-zju/4436855 to your computer and use it in GitHub Desktop.
Java hello world in jar with Makefile
public class Hello {
public static void main(String args[]) {
System.out.println("hello world");
}
}
PHONY: all clean
all: hello.jar
Hello.class: Hello.java
javac $^
hello.jar: Hello.class
jar -cfe $@ Hello $^
clean:
-rm -f hello.jar Hello.class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment