Things I Needed to Know
2009-Dec-12, Saturday 12:44 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
To make an executable jar (laugh if you want, but I was always happy without an executable):
- need to be in bin folder (or the root of your .class structure)
- create manifest.mf, add:
Main-class: socket/client/main
- jar -cvfm socketclient.jar manifest.mf socket/client
- chomd 777 socketclient.jar
- ./socketclient.jar 9.88.44.3 (or java -jar socketclient.jar 9.88.44.3)
- need to be in bin folder (or the root of your .class structure)
- create manifest.mf, add:
Main-class: socket/client/main
- jar -cvfm socketclient.jar manifest.mf socket/client
- chomd 777 socketclient.jar
- ./socketclient.jar 9.88.44.3 (or java -jar socketclient.jar 9.88.44.3)
no subject
Date: 2011-03-11 11:00 pm (UTC)Create a folder; META-INF. In this folder create a file; MANIFEST.MF with the following contents;
Manifest-Version: 1.0
Created-By: 1.6.0_20 (Sun Microsystems Inc.)
Main-class: Main
Make sure to end the file with a blank line.
Then back in your bin dir;
jar -cvfe myjar.jar Main Main.class all.class my.class files.class
Then to run;
java -jar myjar.jar
no subject
Date: 2011-03-14 12:49 pm (UTC)jar -cvf source.jar Encrypt0.java Encrypt1.java AESCipher.java Utils.java
jar xvf source.jar
javac *.java
java Encrypt0 127.0.0.1 8002 "hello there"