¾È³çÇϼ¼¿ä
ÇöÀç ÇÁ·ÎÁ§Æ®³» ÆÄÀÏÀ» Áý¾î³Ö°í ÀÌ°É ¾î´À Çǽÿ¡¼ µ¹·Áµµ ½ÇÇàµÇ°Ô²û »ó´ë°æ·Î¸¦ ÂüÁ¶½ÃÅ°·Á°í Çϴµ¥ Àß ¾ÈµÇ¼ °í¹ÎÀÔ´Ï´Ù.
ÇÁ·ÎÁ§Æ® ±¸¼ºÀº ¾Æ·¡Ã³·³µÇ¾îÀÖ°í lib Æú´õ ³» chromedriver.exe¸¦ °æ·Î·Î ³Ö¾îÁÖ·Á°í ÇÕ´Ï´Ù.
File file = new File("."+File.separator+"lib\\"+"chromedriver.exe");
ÀÌ·¸°Ôµµ Çغ¸°í"
String path = FileTest.class.getResource("").getPath(); // ÇöÀç Ŭ·¡½ºÀÇ Àý´ë °æ·Î¸¦ °¡Á®¿Â´Ù.
System.out.println(path); //--> Àý´ë °æ·Î°¡ Ãâ·ÂµÊ
ÀÌ·±½ÄÀ¸·Î Çغ¸°í Á™´Âµ¥ °æ·Î ÂüÁ¶°¡ µÇÁö ¾Ê½À´Ï´Ù
ƯÈ÷ ÀÌŬ¸³½º³»¿¡¼´Â ½ÇÇàÀÌ µÇ´Âµ¥ ½ÇÇà°¡´ÉÇÑ jar ·Î exportÈÄ ¾È µÇ´Â °æ¿ì°¡ ¸¹½À´Ï´Ù.
¾î¶² ¹æ¹ýÀ¸·Î ÇؾßÇϳª¿ä?
3
String path = FileTest.class.getResource("").getPath(); // ÇöÀç Ŭ·¡½ºÀÇ Àý´ë °æ·Î¸¦ °¡Á®¿Â´Ù.
System.out.println(path); //--> Àý´ë °æ·Î°¡ Ãâ·ÂµÊ
|
classpath ·çÆ®·Î ÇØ´ç ÆÄÀÏÀÌ °°ÀÌ ¹èÆ÷ µÉ ÅÙµ¥¿ä.. ±×·³. \"/chromedriver.exe\" ÀÌ·¸°Ô Á¢±ÙµÉ °Í °°Àºµ¥..