터미널 jar 파일 생성

터미널 jar 파일 생성

# 터미널 jar 파일 생성

1. java 파일 생성

# cat Hello.java public class Hello { public static void main(String args[]){ System.out.println("hello world"); } }

2. 컴파일

# javac Hello.java

3. manifest.txt 파일 생성

# cat manifest.txt Main-class: Hello

※ manifest.txt 파일이란? jar로 패키지된 파일 구성요소의 메타 정보를 가지고 있는 파일이다.

4. jar 파일 생성

# jar -cvmf manifest.txt hello.jar Hello.class Manifest를 추가함 추가하는 중: Hello.class(입력 = 415) (출력 = 286)(31%를 감소함)

5. jar 파일 실행

# java -jar hello.jar hello world

To be continued.........

Made by 꿩

from http://scorpio-mercury.tistory.com/36 by ccl(A) rewrite - 2021-10-05 11:01:59