Question
How to make a JAR from .java without help of IDE by javac and jar? Consider we have below files:
- # tree ./
- ./
- ├── bin
- ├── libs
- │ └── commons-cli-1.4.jar
- └── src
- └── Hello.java
- 3 directories, 2 files
How-To
First at all, let's compile Hello.java:
Then it is time to archive *.class into Hello.jar:
Finally, let's test the jar:
Supplement
* javac - Java programming language compiler
* jar - Manipulates Java Archive (JAR) files.
沒有留言:
張貼留言