Created
August 18, 2020 10:26
-
-
Save shanenoi/02784beed5c7d9055fa2510e7d77e097 to your computer and use it in GitHub Desktop.
Tìm hiểu Java khá lâu rồi nay mới biết cách build file jar bằng command :)
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
FILE=hello_world | |
CONTENT=$(cat <<-END | |
public class $FILE { | |
public static void main(String[] args) { | |
System.out.println( | |
"Excuse me, what the fuck!\\\n" + | |
"U dont know how to build jar by command?" | |
); | |
} | |
} | |
END | |
) | |
printf "${CONTENT}" >$FILE.java | |
javac $FILE.java | |
printf "Main-Class: ${FILE}\n" >manifest | |
jar cfm $FILE.jar manifest $FILE.class | |
rm $FILE.java \ | |
$FILE.class \ | |
manifest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment