Last active
July 15, 2020 18:14
-
-
Save quark-zju/4436855 to your computer and use it in GitHub Desktop.
Java hello world in jar with Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Hello { | |
public static void main(String args[]) { | |
System.out.println("hello world"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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