[Eclipse] Error: Could not find or load main class ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

GitHub Desktop์—์„œ pull request๋ฅผ ํ•œ ํ›„, Eclipse์—์„œ ํด๋ž˜์Šค ํŒŒ์ผ์„ ์‹คํ–‰์‹œํ‚ค๋ ค๊ณ  ํ•  ๋•Œ "Could not find or load main class" ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด ์˜ค๋ฅ˜๋Š” Eclipse์—์„œ ์ž๋ฐ” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ์ง€ ์•Š๊ฑฐ๋‚˜ ์ฝ”๋“œ ๋‚ด์— ์˜คํƒˆ์ž๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ ๋ฐœ์ƒํ•œ๋‹ค. ์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ํ”„๋กœ์ ํŠธ์˜ Properties์—์„œ Java Build Path ํ•ญ๋ชฉ์„ ํ™•์ธํ•˜๊ณ , Libraries ํƒญ์—์„œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š”์ง€, Order and Export ํƒญ์—์„œ Libraries๊ฐ€ ์ฒดํฌ๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•ด์•ผ ํ•œ๋‹ค.
Jan 19, 2024
[Eclipse] Error: Could not find or load main class ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

๊ฐœ์š”

  • GitHub Desktop์—์„œ pull request๋ฅผ ํ•œ ํ›„, Eclipse์—์„œ ํด๋ž˜์Šค ํŒŒ์ผ์„ ์‹คํ–‰์‹œํ‚ค๋ ค๊ณ  ํ•˜๋‹ˆ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.
Error: Could not find or load main class ํŒจํ‚ค์ง€๋ช….ํด๋ž˜์Šค๋ช… Caused by: java.lang.ClassNotFoundException: ํŒจํ‚ค์ง€๋ช….ํด๋ž˜์Šค๋ช…

์›์ธ

  • Eclipse์—์„œ ์ž๋ฐ” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ์ง€ ์•Š์„ ๊ฒฝ์šฐ, ๋˜๋Š” ์ฝ”๋“œ ๋‚ด ํŒจํ‚ค์ง€, ํด๋ž˜์Šค ์ด๋ฆ„, ํŒŒ์ผ ๋ช… ๋“ฑ์— ์˜คํƒˆ์ž๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ ํ•ด๋‹น ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  1. ํ•ด๋‹น ํ”„๋กœ์ ํŠธ ์šฐํด๋ฆญ > Properties ์„ ํƒ
  1. Java Build Path ํ•ญ๋ชฉ์˜ Libraries ํƒญ์—์„œ ModulPath์™€ Classpath์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ.
  1. Order and Export ํƒญ์—์„œ Libraries ๋“ค์ด ์ฒดํฌ๋˜์–ด์žˆ์ง€ ์•Š๋‹ค๋ฉด ์ฒดํฌํ•œ๋‹ค.
notion image
 
 
notion image
notion image
 
Share article

More articles

See more posts

[programmers] ๋ฐฐ์—ด ๋งŒ๋“ค๊ธฐ 6 - Java

January 18, 2024
[programmers] ๋ฐฐ์—ด ๋งŒ๋“ค๊ธฐ 6 - Java

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ปDriedPollack's Blog