๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

IT-Engineering/Java2

์ž๋ฐ”(Java) ๋ฒ„์ „ ํ™•์ธ ๋ฐ ๊ธฐ๋ณธ์œผ๋กœ ์‚ฌ์šฉํ•  Java ๋ฒ„์ „ ๋ณ€๊ฒฝํ•˜๊ธฐ(JDK ์—ฌ๋Ÿฌ๊ฐœ ์‚ฌ์šฉ์‹œ) ๋ฆฌ๋ˆ…์Šค(Linux)์—์„œ ์ž๋ฐ”(Java) ๊ฒฝ๋กœ๋ฅผ ๋จผ์ € ํ™•์ธํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด, ์•„๋ž˜์˜ ๊ธ€์„ ์ฝ์–ด๋ณด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค! ์šฐ๋ถ„ํˆฌ(Ubuntu)์—์„œ ์ž๋ฐ”(Java) ๊ฒฝ๋กœ(path) ์ฐพ๊ธฐ ๊ฐ€๋” ์šฐ๋ถ„ํˆฌ์—์„œ ์ž‘์—…ํ•˜๋‹ค ๋ณด๋ฉด, ๋‚ด๊ฐ€ ์ž๋ฐ”๋ฅผ ๋”ฐ๋กœ ์••์ถ•ํŒŒ์ผ์„ ๋ฐ›์•„์„œ ์„ค์น˜ํ–ˆ๋Š”์ง€ apt-get ๋ช…๋ น์–ด๋กœ ์„ค์น˜ํ–ˆ๋Š”์ง€๋„ ํ—ท๊ฐˆ๋ฆด ๋•Œ๊ฐ€ ์žˆ๋‹ค. (feat.๊ธฐ์–ต๋ ฅ ๊ฐํ‡ด) ์ด์— ์„ค์น˜๋œ ์ž๋ฐ” ๊ฒฝ๋กœ๋ฅผ ์ฐพ๋Š” ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ• gentlesark.tistory.com Java ๋ฒ„์ „์„ ํ™•์ธํ•˜๋Š” ๋ช…๋ น์–ด๋Š” ์•„๋ž˜์™€ ๊ฐ™๋‹ค. java -version openjdk version "1.8.0_252" OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09) OpenJDK 64-Bit Server VM (bui.. 2020. 7. 17.
์šฐ๋ถ„ํˆฌ(Ubuntu)์—์„œ ์ž๋ฐ”(Java) ๊ฒฝ๋กœ(path) ์ฐพ๊ธฐ ๊ฐ€๋” ์šฐ๋ถ„ํˆฌ์—์„œ ์ž‘์—…ํ•˜๋‹ค ๋ณด๋ฉด, ๋‚ด๊ฐ€ ์ž๋ฐ”๋ฅผ ๋”ฐ๋กœ ์••์ถ•ํŒŒ์ผ์„ ๋ฐ›์•„์„œ ์„ค์น˜ํ–ˆ๋Š”์ง€ apt-get ๋ช…๋ น์–ด๋กœ ์„ค์น˜ํ–ˆ๋Š”์ง€๋„ ํ—ท๊ฐˆ๋ฆด ๋•Œ๊ฐ€ ์žˆ๋‹ค. (feat.๊ธฐ์–ต๋ ฅ ๊ฐํ‡ด) ์ด์— ์„ค์น˜๋œ ์ž๋ฐ” ๊ฒฝ๋กœ๋ฅผ ์ฐพ๋Š” ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ์ •๋ฆฌํ•ด๋ณธ๋‹ค. ๋ฐฉ๋ฒ• 1 ํ„ฐ๋ฏธ๋„์—์„œ์˜ ๋‹ค์Œ์˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•œ๋‹ค. update-alternatives --list java ๋ฐฉ๋ฒ• 1์ด ๊ฐ„๋‹จํ•˜๊ณ  ์‰ฝ์ง€๋งŒ, ์ข€ ๋” ๋ณต์žกํ•˜๊ฒŒ(???) ์•Œ๊ณ ์ž ํ• ๋•Œ ๋ฐฉ๋ฒ• 2๋„ ์žˆ๋‹ค. ๋ฐฉ๋ฒ• 2 whereis java ์ž…๋ ฅ์—์„œ ๋‚˜์˜จ /usr/bin/java๋ฅผ ์ด์šฉ ls -l /usr/bin/java ๋‹ค์‹œ ์ถœ๋ ฅ๋œ ๋งํ‚น ์ฃผ์†Œ๋ฅผ ์ด์šฉํ•˜์—ฌ ls -l /etc/alternatives/java ํ•˜๋ฉด ์ตœ์ข…์ ์ธ ์ฃผ์†Œ๊ฐ€ ์ถœ๋ ฅ๋  ๊ฒƒ์ด๋‹ค. 2020. 3. 26.