A memo on how to create jar files from the command line in Java.
There are various explanations about manifest files, jar cvf YourJar.jar *, and jar -cf, which can be confusing,
but in my case, I was able to do it with the following commands.
# # Compile Java
javac -encoding UTF-8 -d ./build *.java
cd build
# # Can test with java SetClipboardWithBtn.
# # Set the first argument to any filename, the second argument to the class name of the main Java file, and create a jar file with all the class files to be used together.
jar cfe SetClipboardWithBtn.jar SetClipboardWithBtn *.class
# # Can execute by clicking the created jar file or with `java -jar SetClipboardWithBtn.jar`.
Reference: