๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ปTech/๐ŸงLinux

[๋ฆฌ๋ˆ…์Šค] jar ํŒŒ์ผ ์ƒ์„ฑ ๋ฐ ์‹คํ–‰ ๋ฐฉ๋ฒ•

by _viper_ 2019. 5. 29.
๋ฐ˜์‘ํ˜•

์ดํด๋ฆฝ์Šค๋กœ jar ํŒŒ์ผ ์ƒ์„ฑํ•˜์—ฌ ๋ฆฌ๋ˆ…์Šค์ƒ์—์„œ jar ํŒŒ์ผ ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

์ž๋ฐ”์ฝ”๋“œ๋Š” ๋ฉ”์ธํ•จ์ˆ˜๋กœ ์ž…๋ ฅ๋˜๋Š” ๊ฐ’์„ ์ถœ๋ ฅํ•˜๋Š” ๊ฐ„๋‹จํ•œ ์ฝ”๋“œ๋กœ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.

public class test{
  public static void main(String[] args){
    for(String arg:args){
      System.out.println(arg);
    }
  }
}

 

1. eclipse๋กœ jar ํŒŒ์ผ ์ƒ์„ฑ

 

๋ฉ”์ธ ํด๋ž˜์Šค๋ฅผ ์ง€์ •ํ•ด์ฃผ์ง€ ์•Š์œผ๋ฉด no main manifest attribute, in test.jar ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

 

 

 2. ์ƒ์„ฑํ•œ jar ํŒŒ์ผ์„ ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„๋กœ ์ด๋™์‹œํ‚ค๊ณ  ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰

java -jar test.jar TEST

 

[์‹คํ–‰ ๊ฒฐ๊ณผ]

TEST