Created
April 6, 2016 01:48
-
-
Save kedarmhaswade/f18e3d3809c8467ccaa76958fd5b9542 to your computer and use it in GitHub Desktop.
How to make a JAR!
This file contains hidden or 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
➜ /tmp tree com | |
com | |
└── test | |
└── Test.java | |
1 directory, 2 files | |
➜ /tmp more com/test/Test.java | |
package com.test; | |
class Test { | |
public static void main(String[] args) { | |
System.out.println("Hello!"); | |
} | |
} | |
➜ /tmp javac com/test/Test.java | |
➜ /tmp tree com | |
com | |
└── test | |
├── Test.class | |
└── Test.java | |
1 directory, 2 files | |
➜ /tmp more MANIFEST.MF | |
Main-Class: com.test.Test | |
➜ /tmp jar cvfm test.jar MANIFEST.MF com/test/Test.class | |
added manifest | |
adding: com/test/Test.class(in = 417) (out= 289)(deflated 30%) | |
➜ /tmp java -jar test.jar | |
Hello! | |
=> So it does work as expected. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment