Manpages

Manpage of javac

javac

Section: User Commands (1)
Updated: 2000 ǯ 7 ·î 28 Æü
Index
Return to Main Contents
 

̾Á°

javac - Java ¥³¥ó¥Ñ¥¤¥é  

·Á¼°

javac [ -bootclasspath bootclasspath ]
      [ -classpath classpath ] [ -d directory ]
      [ -deprecation ] [ -encoding ] [ -extdirs directories ]
      [ -g | -g:none | -g:keyword-list ] [ -Joption ]
      [ -nowarn ] [ -O ] [ -sourcepath sourcepath ]
      [ -target version ] [ -verbose ] [ -X ] [ -Xdepend ]
      [ -Xstdout ] [ -Xverbosepath [ sourcefiles ] [ @files ]  

¥Ñ¥é¥á¡¼¥¿

¥ª¥×¥·¥ç¥ó¤Î½ç½ø¤ÏǤ°Õ¤Ç¤¹¡£ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤ËŬÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢¡Ö¥ª¥×¥·¥ç¥ó¡×Àá¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
sourcefiles
¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤ë 1 ¤Ä°Ê¾å¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë (MyClass.java ¤Ê¤É)
@files
¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò°ìÍ÷ɽ¼¨¤¹¤ë 1 ¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë

 

µ¡Ç½ÀâÌÀ

javac ¥Ä¡¼¥ë¤Ï¡¢Java ¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Çµ­½Ò¤µ¤ì¤¿¥¯¥é¥¹¤È¥¤¥ó¥¿¥Õ¥§¡¼¥¹ ¤ÎÄêµÁ¤òÆɤ߼è¤ê¡¢¥Ð¥¤¥È¥³¡¼¥É¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£

¥½¡¼¥¹¥³¡¼¥É¤Î¥Õ¥¡¥¤¥ë̾¤ò javac ¤ËÅϤ¹¤Ë¤Ï¡¢¼¡¤Î 2 ¤Ä¤ÎÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£

*
¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¿ô¤¬¾¯¤Ê¤¤¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë̾¤ò¥³¥Þ¥ó¥É¹Ô¤Ç ľÀÜ»ØÄꤷ¤Þ¤¹¡£
*
¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¿ô¤¬Â¿¤¤¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë̾¤ò¶õÇò¤Þ¤¿¤Ï¹Ô¥Ö¥ì¡¼¥¯¤Ç ¶èÀڤäƥե¡¥¤¥ë¤Ëµ­½Ò¤·¤Þ¤¹¡£¼¡¤Ë¡¢¤³¤Î¥ê¥¹¥È¥Õ¥¡¥¤¥ë̾¤ÎÀèƬ¤Ë @ ¤ò ÉÕ¤±¤Æ javac ¤Î¥³¥Þ¥ó¥É¹Ô¤Ç»ØÄꤷ¤Þ¤¹¡£

¥½¡¼¥¹¥³¡¼¥É¤Î¥Õ¥¡¥¤¥ë̾¤Ï .java ³ÈÄ¥»Ò¡¢¥¯¥é¥¹¤Î¥Õ¥¡¥¤¥ë̾¤Ï .class ³ÈÄ¥»Ò¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ ¤Þ¤¿¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Î¤É¤Á¤é¤â¡¢³ºÅö¤¹¤ë¥¯¥é¥¹¤ËÂбþ¤·¤¿ ¥ë¡¼¥È̾¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤¿¤È¤¨¤Ð¡¢ MyClass ¤È¤¤¤¦Ì¾Á°¤Î ¥¯¥é¥¹¤Ï¡¢ MyClass.java ¤È¤¤¤¦Ì¾Á°¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤·¤Þ¤¹¡£¤³¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ï¡¢ MyClass.class ¤È¤¤¤¦Ì¾Á°¤Î¥Ð¥¤¥È¥³¡¼¥É¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Þ¤¹¡£

ÆâÉô¥¯¥é¥¹ÄêµÁ¤Ï¡¢ÄɲäΥ¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤ì¤é¤Î¥¯¥é¥¹¥Õ¥¡ ¥¤¥ë¤Î̾Á°¤Ï¡¢ MyClass$MyInnerClass.class ¤Î¤è¤¦¤Ë¡¢ÆâÉô¥¯¥é¥¹Ì¾¤È³°Éô¥¯¥é¥¹Ì¾¤òÁȤ߹ç¤ï¤»¤¿¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£

¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ñ¥Ã¥±¡¼¥¸¥Ä¥ê¡¼¤òÈ¿±Ç¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¤ËÇÛÃÖ ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢¤¹¤Ù¤Æ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò /workspace ¤ËÃÖ¤¤¤Æ¤¤¤ë¾ì¹ç¡¢ com.mysoft.mypack.MyClass ¤Î¥½¡¼¥¹¥³¡¼¥É¤Ï /workspace/com/mysoft/mypack/MyClass.java ¤Ë¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥³¥ó¥Ñ¥¤¥é¤Ï³Æ¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÂбþ¤¹¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È Ʊ¤¸¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤­¤Þ¤¹¡£ -d (¸å½Ò¤Î¡Ö¥ª¥×¥·¥ç¥ó¡×¤ò»²¾È) ¤ò»È¤¦¤È¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¤¢¤ë¾ì½ê¤È¤Ï°Û ¤Ê¤ë½ÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£

 

·¿¤Î¸¡º÷

¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¤­¡¢¥³¥ó¥Ñ¥¤¥é¤Ë¤Ï¡¢¤Þ¤Àǧ¼±¤·¤Æ¤¤¤Ê ¤¤·¿¤Ë´Ø¤¹¤ë¾ðÊó¤¬É¬Íפˤʤ뤳¤È¤¬¤¢¤ê¤Þ¤¹¡£¥³¥ó¥Ñ¥¤¥é¤Ë¤Ï¡¢¥½¡¼¥¹ ¥Õ¥¡¥¤¥ë¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥¯¥é¥¹¤Þ¤¿¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹¡¢³ÈÄ¥¤µ¤ì¤Æ¤¤¤ë¥¯¥é¥¹ ¤Þ¤¿¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹¡¢¤¢¤ë¤¤¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¥¯¥é¥¹¤Þ¤¿¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹ ¤½¤ì¤¾¤ì¤Î·¿¾ðÊó¤¬É¬ÍפǤ¹¡£¤³¤ì¤Ë¤Ï¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÇÌÀ¼¨Åª¤Ë¤Ï ¸ÀµÚ¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢·Ñ¾µ¤òÄ̤¸¤Æ¾ðÊó¤òÄ󶡤¹¤ë¥¯¥é¥¹¤È¥¤¥ó¥¿¥Õ¥§¡¼¥¹ ¤â´Þ¤Þ¤ì¤Þ¤¹¡£

¤¿¤È¤¨¤Ð¡¢java.applet.Applet ¤ò¥µ¥Ö¥¯¥é¥¹²½¤¹¤ë¾ì¹ç¤Ï¡¢Applet ¤Î¾å°Ì¥¯¥é¥¹¤Ç¤¢¤ë java.awt.Panel¡¢ java.awt.Container¡¢ java.awt.Component ¡¢¤ª¤è¤Ó java.awt.Object ¤â»È¤Ã¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£

¥³¥ó¥Ñ¥¤¥é¤Ï¡¢·¿¾ðÊó¤¬É¬Íפˤʤë¤È¡¢³ºÅö¤¹¤ë·¿¤òÄêµÁ¤·¤Æ¤¤¤ë¥½¡¼¥¹ ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òõ¤·¤Þ¤¹¡£¥³¥ó¥Ñ¥¤¥é¤Ï¡¢¤Þ¤º¡¢¥Ö¡¼¥È¥¹ ¥È¥é¥Ã¥×¥¯¥é¥¹¤È³ÈÄ¥µ¡Ç½¥¯¥é¥¹¤ò¸¡º÷¤·¡¢¼¡¤Ë¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤ò¸¡º÷ ¤·¤Þ¤¹¡£¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Ï¡¢ CLASSPATH ´Ä¶­ÊÑ¿ô¤òÀßÄꤹ¤ë¤«¡¢¤¢¤ë¤¤¤Ï -classpath ¥³¥Þ¥ó¥É¹Ô¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤ÆÀßÄꤷ¤Þ¤¹ (¾ÜºÙ¤Ï¡¢¡Ö ¥¯¥é¥¹¥Ñ¥¹¤ÎÀßÄê ¡× ¤ò»²¾È)¡£ -sourcepath ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥³¥ó¥Ñ¥¤¥é¤Ï¡¢»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ç¥½¡¼¥¹ ¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Ç¥¯¥é¥¹ ¥Õ¥¡¥¤¥ë¤È¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¸¡º÷¤·¤Þ¤¹¡£ -bootclasspath ¥ª¥×¥·¥ç¥ó¤È -extdirs ¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢Ê̤Υ֡¼¥È¥¹¥È¥é¥Ã¥×¥¯¥é¥¹¤ä³ÈÄ¥µ¡Ç½¥¯¥é¥¹¤ò»ØÄê ¤Ç¤­¤Þ¤¹¡£¸å½Ò¤Î¡Ö ¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥ó ¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

·¿¤Î¸¡º÷¤ËÀ®¸ù¤·¤¿¤È¤­¤ËÆÀ¤é¤ì¤ë·ë²Ì¤Ï¡¢¥¯¥é¥¹¥Õ¥¡¥¤¥ë¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë¡¢¤Þ¤¿¤Ï¤½¤ÎξÊý¤Ç¤¢¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤½¤ì¤¾¤ì¤Î¾ì¹ç¤Ë javac ¤¬¤É¤Î¤è¤¦¤Ë½èÍý¤ò¹Ô¤¦¤«¤ò¼¡¤Ë¼¨¤·¤Þ¤¹¡£

*
¸¡º÷¤Ç¸«¤Ä¤«¤Ã¤¿¤â¤Î¤¬¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¯¡¢¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë ¾ì¹ç¡¢ javac ¤Ï¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£
*
¸¡º÷¤Ç¸«¤Ä¤«¤Ã¤¿¤â¤Î¤¬¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¯¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë ¾ì¹ç¡¢ javac ¤Ï¡¢³ºÅö¤¹¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤·¡¢¤½¤Î·ë²ÌºîÀ®¤µ¤ì¤ë¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£
*
¸¡º÷¤Ç¸«¤Ä¤«¤Ã¤¿¤â¤Î¤¬¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤Ç¤¢¤ë ¾ì¹ç¡¢ javac ¤Ï¡¢¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤¬¸Å¤¯¤Ê¤Ã¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤Þ¤¹¡£¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤¬ ¸Å¤¯¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤·¡¢¹¹¿·¸å¤Î ¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¸«¤Ä¤«¤Ã¤¿¥¯¥é¥¹¥Õ¥¡¥¤ ¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£

¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤¬¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤è¤ê¸Å¤¤¾ì¹ç¤Ë¤Î¤ß¡¢ javac ¤Ï¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤¬¸Å¤¯¤Ê¤Ã¤Æ¤¤¤ë¤ÈȽÃǤ·¤Þ¤¹¡£ -Xdepend ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢½èÍý®ÅÙ¤ÏÃÙ¤¯¤Ê¤ê¤Þ¤¹¤¬¡¢¤è¤ê¿®ÍêÀ­¤Î¹â¤¤ÊýË¡¤ÇȽÃǤ·¤Þ¤¹¡£

javac ¤Ï¡¢¥³¥Þ¥ó¥É¹Ô¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¤­¤Ç ¤â¡¢¤½¤Î¤³¤È¤ò¼¨¤¹¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó¡£¼«Æ°¥³¥ó¥Ñ¥¤¥ë¤ò¥È¥ì¡¼¥¹¤¹ ¤ë¤Ë¤Ï¡¢ -verbose ¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£

 

¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È

javac ¥³¥Þ¥ó¥É¤òû¤¯´Ê·é¤Ë¤¹¤ë¤¿¤á¤Ë¡¢³Æ¹Ô¤Ë¥Õ¥¡¥¤¥ë̾¤¬ 1 ¤Äµ­½Ò¤µ¤ì¤Æ¤¤ ¤ë¥Õ¥¡¥¤¥ë¤ò 1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥³¥Þ¥ó¥É¹Ô¤Ç¡¢¥Õ¥¡¥¤ ¥ë̾¤Ë¡Ö@¡×ʸ»ú¤òÉÕ¤±¤ë¤³¤È¤Ë¤è¤ê¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È¤È¤· ¤Æ»ØÄê¤Ç¤­¤Þ¤¹¡£ javac ¤Ï¡¢¡Ö@¡×ʸ»ú¤Ç»Ï¤Þ¤ë°ú¿ô¤ËÁø¶ø¤¹¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ëÆâ¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë̾ ¤¬¥³¥Þ¥ó¥É¹Ô¤Ë½ñ¤«¤ì¤Æ¤¤¤¿¤«¤Î¤è¤¦¤Ë¡¢¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë̾¤ËÂФ·¤ÆÁàºî ¤ò¹Ô¤¤¤Þ¤¹¡£

¤¿¤È¤¨¤Ð¡¢sourcefiles ¤È¤¤¤¦¥Õ¥¡¥¤¥ëÆâ¤Ë¡¢¼¡¤Î¤è¤¦¤Ë¤¹¤Ù¤Æ¤Î¥½¡¼¥¹¥Õ¥¡¥¤ ¥ë̾¤Î¥ê¥¹¥È¤òµ­½Ò¤Ç¤­¤Þ¤¹¡£

    MyClass1.java
    MyClass2.java
    MyClass3.java

¼¡¤Î¥³¥Þ¥ó¥É¤ò»È¤Ã¤Æ¡¢¥³¥ó¥Ñ¥¤¥é¤ò¼Â¹Ô¤Ç¤­¤Þ¤¹¡£

   example% javac @sourcefiles

 

¥ª¥×¥·¥ç¥ó

¥³¥ó¥Ñ¥¤¥é¤Ë¤Ï¡¢¸½ºß¤Î³«È¯´Ä¶­¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¡¢¾­Íè¤Î¥ê¥ê¡¼¥¹¤Ç¤â ¥µ¥Ý¡¼¥È¤µ¤ì¤ëɸ½à¥ª¥×¥·¥ç¥ó¤Î¥»¥Ã¥È¤¬¤¢¤ê¤Þ¤¹¡£Èóɸ½à¥ª¥×¥·¥ç¥ó¤Î Êä­Ū¤Ê¥»¥Ã¥È¤Ï¡¢¸½ºß¤Î Virtual Machine ¤Î¼ÂÁõÆÃÍ­¤Î¤â¤Î¤Ç¡¢¾­Íè Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£Èóɸ½à¥ª¥×¥·¥ç¥ó¤Ï¡¢ -X ¤Ç»Ï¤Þ¤ê¤Þ¤¹¡£  

ɸ½à¥ª¥×¥·¥ç¥ó

-classpath classpath
¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤òÀßÄꤷ¡¢ CLASSPATH ´Ä¶­ÊÑ¿ô¤Î¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤ò¾å½ñ¤­¤·¤Þ¤¹¡£ CLASSPATH ¤È -classpath ¤Î¤É¤Á¤é¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Ï¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ê¤Þ¤¹¡£¾ÜºÙ¤Ï¡¢¡Ö ¥¯¥é¥¹¥Ñ¥¹¤ÎÀßÄê ¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

-sourcepath ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥¯¥é¥¹¥Õ¥¡¥¤¥ëƱÍÍ¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë ¤â¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Ç¸¡º÷¤µ¤ì¤Þ¤¹¡£

-d directory
¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Î½ÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤òÀßÄꤷ¤Þ¤¹¡£¥¯¥é¥¹¤¬¥Ñ¥Ã¥±¡¼¥¸¤Î °ìÉô¤Ç¤¢¤ë¾ì¹ç¡¢ javac ¤Ï¡¢É¬Íפ˱þ¤¸¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¡¢¥Ñ¥Ã¥±¡¼¥¸Ì¾¤òÈ¿±Ç¤·¤¿¥µ¥Ö¥Ç¥£ ¥ì¥¯¥È¥ê¤Ë¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤­¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢ -d /home/myclasses ¤È»ØÄꤷ¡¢¥¯¥é¥¹¤Î̾Á°¤¬ com.mypackage.MyClass ¤Ç¤¢¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ï /home/myclasses/com/mypackage/MyClass.class ¤Ë¤Ê¤ê¤Þ¤¹¡£

-d ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ javac ¤Ï¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÈƱ¤¸¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤­¤Þ¤¹¡£

-d ¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Ë¼«Æ°Åª¤ËÄɲ䵤ì¤ë¤ï¤± ¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£

-deprecation
¿ä¾©¤µ¤ì¤Ê¤¤¥á¥ó¥Ð¤ä¥¯¥é¥¹¤¬¡¢»ÈÍѤ¢¤ë¤¤¤Ï¥ª¡¼¥Ð¡¼¥é¥¤¥É¤µ¤ì¤ë¤¿¤Ó¤ËÀâÌÀ¤òɽ¼¨¤·¤Þ¤¹¡£ -deprecation ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ javac ¤Ï¡¢¿ä¾©¤µ¤ì¤Ê¤¤¥á¥ó¥Ð¤ä¥¯¥é¥¹¤ò»ÈÍѤ¢¤ë¤¤¤Ï¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Æ¤¤¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î̾Á°¤òɽ¼¨¤·¤Þ¤¹¡£
-encoding
¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾ (EUCJIS/SJIS ¤Ê¤É) ¤ò»ØÄꤷ¤Þ¤¹¡£ -encoding ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¥Ç¥Õ¥©¥ë¥È¥³¥ó¥Ð¡¼¥¿¤¬ »È¤ï¤ì¤Þ¤¹¡£
-g
¶É½êÊÑ¿ô¤ò´Þ¤à¤¹¤Ù¤Æ¤Î¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ¸À®¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ ¹ÔÈֹ椪¤è¤Ó¥½¡¼¥¹¥Õ¥¡¥¤¥ë¾ðÊó¤À¤±¤¬À¸À®¤µ¤ì¤Þ¤¹¡£
-g:none
¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ¸À®¤·¤Þ¤»¤ó¡£
-g:keyword-list
¥«¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¥­¡¼¥ï¡¼¥É¥ê¥¹¥È¤Ë¤è¤ê»ØÄꤵ¤ì¤¿¡¢ÆÃÄê¤Î¼ïÎà¤Î ¥Ç¥Ð¥Ã¥°¾ðÊó¤À¤±¤òÀ¸À®¤·¤Þ¤¹¡£¼¡¤Î¥­¡¼¥ï¡¼¥É¤¬Í­¸ú¤Ç¤¹¡£
source
¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¥Ç¥Ð¥Ã¥°¾ðÊó
lines
¹ÔÈÖ¹æ¤Î¥Ç¥Ð¥Ã¥°¾ðÊó
vars
¶É½êÊÑ¿ô¤Î¥Ç¥Ð¥Ã¥°¾ðÊó
-nowarn
·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó¡£
-O
Ãí: javac ¤Î¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢ -O ¥ª¥×¥·¥ç¥ó¤Ë¤Ï¤Þ¤Ã¤¿¤¯¸úÎϤ¬¤¢¤ê¤Þ¤»¤ó¡£¼Â¹Ô»þ¤Î¥³¡¼¥É¤òºÇŬ²½¤·¤Þ¤¹¡£ -O ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¥³¥ó¥Ñ¥¤¥ë®ÅÙ¤¬Äã²¼¤·¡¢ºîÀ®¤µ¤ì¤ë¥¯¥é¥¹ ¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤¬ÁýÂ礷¤Æ¡¢¥Ç¥Ð¥Ã¥°¤Îº¤Æñ¤Ê¥×¥í¥°¥é¥à¤¬À¸À®¤µ¤ì¤ë ¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£

JDK 1.2 ¤è¤êÁ°¤Ï¡¢ javac ¤Î -g ¥ª¥×¥·¥ç¥ó¤È -O ¥ª¥×¥·¥ç¥ó¤ò°ì½ï¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£JDK 1.2 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î ¥ª¥×¥·¥ç¥ó¤òÁȤ߹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢ÊÑ¿ô¤ÎÁÓ¼º¡¢¥³¡¼¥É¤Î°ÜÆ° ¤äÁÓ¼º¤Ê¤É¤Î»×¤ï¤Ì·ë²Ì¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ -O ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤â¡¢ -depend ¥ª¥×¥·¥ç¥ó¤¬¼«Æ°Åª¤ËÍ­¸ú¤Ë¤Ê¤Ã¤¿¤ê¡¢ -g ¥ª¥×¥·¥ç¥ó¤¬¼«Æ°Åª¤Ë̵¸ú¤Ë¤Ê¤Ã¤¿¤ê¤¹¤ë¤³¤È¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡£¤Þ¤¿¡¢ -O ¤ò»ØÄꤷ¤Æ¤â¡¢Ê£¿ô¤Î¥¯¥é¥¹¤Ë¤Þ¤¿¤¬¤ë¥¤¥ó¥é¥¤¥ó²½¤ÏÍ­¸ú¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó¡£

-sourcepath sourcepath
¥¯¥é¥¹¤Þ¤¿¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÎÄêµÁ¤ò¸¡º÷¤¹¤ë¥½¡¼¥¹¥³¡¼¥É¥Ñ¥¹¤ò»ØÄê ¤·¤Þ¤¹¡£¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹Æ±ÍÍ¡¢¥½¡¼¥¹¥Ñ¥¹¤ÎÊ£¿ô¤Î¥¨¥ó¥È¥ê¤Ï¥³¥í¥ó (:) ¤Ç¶èÀÚ¤ê¤Þ¤¹¡£¥½¡¼¥¹¥Ñ¥¹¤Î¥¨¥ó¥È¥ê¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢JAR ¥¢¡¼¥«¥¤¥Ö¡¢ ¤Þ¤¿¤Ï ZIP ¥¢¡¼¥«¥¤¥Ö¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£¥Ñ¥Ã¥±¡¼¥¸¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ ¥Ç¥£¥ì¥¯¥È¥ê¤Þ¤¿¤Ï¥¢¡¼¥«¥¤¥ÖÆâ¤Î¥í¡¼¥«¥ë¥Ñ¥¹Ì¾¤¬¥Ñ¥Ã¥±¡¼¥¸Ì¾¤òÈ¿±Ç ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£

¥½¡¼¥¹¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Ç¸«¤Ä¤«¤Ã¤¿¥¯¥é¥¹¤Ï¡¢¼«Æ°ºÆ ¥³¥ó¥Ñ¥¤¥ë¤ÎÂоݤˤʤê¤Þ¤¹¡£

-verbose
¾éĹ½ÐÎϤò»ØÄꤷ¤Þ¤¹¡£¥í¡¼¥É¤µ¤ì¤ë¥¯¥é¥¹¤ª¤è¤Ó¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤ë ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤´¤È¤Ë¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£

 

¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥ó

¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥¯¥é¥¹¤Î¥³¥ó¥Ñ¥¤¥ë¤Ï¡¢ javac ¤¬ÅºÉÕ¤µ¤ì¤Æ¤¤¤ë JDK ¤Î¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¥¯¥é¥¹¤ª¤è¤Ó³ÈÄ¥µ¡Ç½¥¯¥é¥¹¤ËÂÐ ¤·¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£¤·¤«¤·¡¢ javac ¤Ï¡¢°Û¤Ê¤ë Java ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¼ÂÁõ¤Î¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¥¯¥é¥¹¤ª¤è¤Ó³ÈÄ¥ µ¡Ç½¥¯¥é¥¹¤ËÂФ·¤Æ¥³¥ó¥Ñ¥¤¥ë¤ò¹Ô¤¦¡Ö ¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë ¡×¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ ¤¹¡£¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¤ò¹Ô¤¦¾ì¹ç¤Ï¡¢ -bootclasspath ¤ª¤è¤Ó -extdirs ¤ò»È¤¦¤³¤È¤¬½ÅÍפǤ¹¡£°Ê²¼¤Î¡Ö¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¤ÎÎã¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

-bootclasspath bootclasspath
»ØÄꤵ¤ì¤¿°ìÏ¢¤Î¥Ö¡¼¥È¥¯¥é¥¹¤ËÂФ·¤Æ¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¤ò¹Ô¤¤¤Þ¤¹¡£¥æ¡¼ ¥¶¥¯¥é¥¹¥Ñ¥¹Æ±ÍÍ¡¢¥Ö¡¼¥È¥¯¥é¥¹¥Ñ¥¹¤ÎÊ£¿ô¤Î¥¨¥ó¥È¥ê¤Ï¥³¥í¥ó (:) ¤Ç¶èÀÚ¤ê ¤Þ¤¹¡£¥Ö¡¼¥È¥¯¥é¥¹¥Ñ¥¹¤Î¥¨¥ó¥È¥ê¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢JAR ¥¢¡¼¥«¥¤¥Ö¡¢¤Þ¤¿ ¤Ï ZIP ¥¢¡¼¥«¥¤¥Ö¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£
-extdirs directories
»ØÄꤵ¤ì¤¿³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¤ò¹Ô¤¤¤Þ¤¹¡£directories ¤Ë¤Ï¡¢¥³¥í¥ó¤Ç¶èÀڤ俥ǥ£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹¡£»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î³Æ JAR ¥¢¡¼¥«¥¤¥Ö¤Ç¡¢¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤¬¸¡º÷¤µ¤ì¤Þ¤¹¡£
-target version
»ØÄꤵ¤ì¤¿¥Ð¡¼¥¸¥ç¥ó¤Î VM ¾å¤ÇÆ°ºî¤¹¤ë¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢1.1 VM ¤È 1.2 VM ¤ÎξÊý¤Ë¸ß´¹À­¤Î¤¢¤ë¥¯¥é¥¹¥Õ¥¡¥¤¥ë ¤òÀ¸À®¤·¤Þ¤¹¡£JDK 1.2 ¤Î javac ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥Ð¡¼¥¸¥ç¥ó¤Ï¼¡¤Î¤È¤ª¤ê ¤Ç¤¹¡£
1.1
À¸À®¤¹¤ë¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤¬¡¢1.1 VM ¤È 1.2 VM ¤Ë¸ß´¹À­¤¬¤¢¤ë¤³¤È¤ò Êݾڤ·¤Þ¤¹¡£¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£
1.2
1.2 VM ¾å¤Ç¤ÏÆ°ºî¤¹¤ë¤¬¡¢1.1 VM ¾å¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¥¯¥é¥¹¥Õ¥¡¥¤¥ë ¤òÀ¸À®¤·¤Þ¤¹¡£
1.3
1.3 °Ê¹ß¤Î VM ¾å¤Ç¤ÏÆ°ºî¤¹¤ë¤¬¡¢1.1 VM ¾å¤Ç¤ÏÆ°ºî¤·¤Ê¤¤ ¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤Þ¤¹¡£
 

Èóɸ½à¥ª¥×¥·¥ç¥ó

-Joption
javac ¤¬¸Æ¤Ó½Ð¤¹ java µ¯Æ°¥³¥Þ¥ó¥É¤Ë¡¢option ¤òÅϤ·¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢ -J-Xms48m ¤È»ØÄꤹ¤ë¤È¡¢¥¹¥¿¡¼¥È¥¢¥Ã¥×¥á¥â¥ê¤Ï 48M ¥Ð¥¤¥È¤ËÀßÄꤵ¤ì¤Þ¤¹¡£¤³¤Î ¥ª¥×¥·¥ç¥ó¤Ï -X ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Þ¤»¤ó¤¬¡¢ javac ¤Î¡Öɸ½à¥ª¥×¥·¥ç¥ó¡×¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¥ª¥×¥·¥ç¥ó¤ò Java ¤Çµ­½Ò¤µ¤ì¤¿ ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¼Â¹Ô¤¹¤ëÇظå¤Î VM ¤ËÅϤ¹¤³¤È¤Ï¡¢ -J ¶¦Ä̤ε¬Â§¤Ç¤¹¡£

CLASSPATH¡¢ -classpath ¡¢ -bootclasspath ¡¢¤ª¤è¤Ó -extdirs ¤Ï¡¢ javac ¤Î¼Â¹Ô¤Ë»È¤¦¥¯¥é¥¹¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³¤Î¤è¤¦¤Ê ÊýË¡¤Ç¥³¥ó¥Ñ¥¤¥é¤Î¼ÂÁõ¤òÁàºî¤¹¤ë¤³¤È¤Ï¡¢Ä̾ï¤Ï̵°ÕÌ£¤Ç¤¢¤ê¡¢¾ï¤Ë ´í¸±¤òȼ¤¤¤Þ¤¹¡£¤³¤Î¤è¤¦¤ÊÊýË¡¤ò»È¤¦É¬Íפ¬¤¢¤ë¾ì¹ç¤Ï¡¢ -J ¥ª¥×¥·¥ç¥ó ¤ò»È¤Ã¤Æ¡¢É¬Íפʥª¥×¥·¥ç¥ó¤òÇظå¤Î java µ¯Æ°¥³¥Þ¥ó¥É¤ËÅϤ·¤Æ¤¯¤À¤µ¤¤¡£

-X
Èóɸ½à¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òɽ¼¨¤·¡¢½ªÎ»¤·¤Þ¤¹¡£
-Xdepend
¥¢¥¯¥»¥¹²Äǽ¤Ê¤¹¤Ù¤Æ¤Î¥¯¥é¥¹¤òºÆµ¢Åª¤Ë¸¡º÷¤·¡¢ºÆ¥³¥ó¥Ñ¥¤¥ëÍѤΤè¤ê ¿·¤·¤¤¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òõ¤·¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢ºÆ¥³¥ó¥Ñ¥¤¥ë¤Î ɬÍפʥ¯¥é¥¹¤ò¤è¤ê¿®ÍêÀ­¤Î¹â¤¤ÊýË¡¤Ç¸¡º÷¤Ç¤­¤Þ¤¹¤¬¡¢¥³¥ó¥Ñ¥¤¥ë½èÍý »þ´Ö¤¬ÂçÉý¤ËŤ¯¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
-Xstdout
¥³¥ó¥Ñ¥¤¥é¤Î¥á¥Ã¥»¡¼¥¸¤ò System.out ¤ËÁ÷¿®¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ ¥³¥ó¥Ñ¥¤¥é¤Î¥á¥Ã¥»¡¼¥¸¤Ï System.err ¤ËÁ÷¿®¤µ¤ì¤Þ¤¹¡£
-Xverbosepath
¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ª¤è¤Ó¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¡¢¥Ñ¥¹¤ª¤è¤Ó ɸ½à³ÈÄ¥µ¡Ç½¤ò¸¡º÷¤¹¤ëÊýË¡¤òµ­½Ò¤·¤Þ¤¹¡£
 

Îã

 

´Êñ¤Ê¥×¥í¥°¥é¥à¤Î¥³¥ó¥Ñ¥¤¥ë

¼¡¤Ë¼¨¤¹¥½¡¼¥¹¥Õ¥¡¥¤¥ë Hello.java ¤Ç¤Ï¡¢ greetings.Hello ¤È¤¤¤¦Ì¾Á°¤Î¥¯¥é¥¹¤òÄêµÁ¤·¤Æ¤¤¤Þ¤¹¡£greetings ¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢¥½¡¼¥¹ ¥Õ¥¡¥¤¥ë¤È¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤Î¥Ñ¥Ã¥±¡¼¥¸¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢¸½ºß¤Î¥Ç¥£¥ì ¥¯¥È¥ê¤Î¤¹¤°²¼¤Ë¤¢¤ê¤Þ¤¹¡£¤³¤Î¤¿¤á¡¢¤³¤ÎÎã¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¥æ¡¼¥¶¥¯¥é¥¹¥Ñ ¥¹¤ò»ÈÍѤǤ­¤Þ¤¹¡£¤Þ¤¿¡¢ -d ¤ò»È¤Ã¤ÆÊ̤νÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ëɬÍפ⤢¤ê¤Þ¤»¤ó¡£

   example% ls
      greetings/
   example% ls greetings
      Hello.java
   example% cat greetings/Hello.java
      package greetings;
   
      public class Hello {
           public static void main(String[] args) {
              for (int i=0; i < args.length; i++) {
                  System.out.println("Hello " + args[i]);
              }
           }
      }
   example% javac greetings/Hello.java
   example% ls greetings
      Hello.class   Hello.java
   example% java greetings.Hello World Universe Everyone
      Hello World
      Hello Universe
      Hello Everyone
 

Ê£¿ô¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¥³¥ó¥Ñ¥¤¥ë

¼¡¤ÎÎã¤Ï¡¢¥Ñ¥Ã¥±¡¼¥¸ greetings Æâ¤Î¤¹¤Ù¤Æ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò ¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£

   example% ls
      greetings/
   example% ls greetings
      Aloha.java     GutenTag.java     Hello.java      Hi.java
   example% javac greetings/*.java
   example% ls greetings
      Aloha.class    GutenTag.class    Hello.class     Hi.class
      Aloha.java     GutenTag.java     Hello.java      Hi.java

 

¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Î»ØÄê

¾å¤ÎÎã¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¤¦¤Á¡¢1 ¤Ä¤òÊѹ¹¤·¡¢Êѹ¹¸å¤Î¥Õ¥¡¥¤¥ë¤ò ºÆ¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£

   example% pwd
      /examples
   example% javac greetings/Hi.java

greetings.Hi ¤Ï¡¢greetings ¥Ñ¥Ã¥±¡¼¥¸Æâ¤Î¤Û¤«¤Î¥¯¥é¥¹¤ò»²¾È¤·¤Æ¤¤¤ë ¤¿¤á¡¢¥³¥ó¥Ñ¥¤¥é¤Ï¤³¤ì¤é¤Î¤Û¤«¤Î¥¯¥é¥¹¤òõ¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£¾å¤ÎÎã¤Ç ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤¬¡¢¥Ñ¥Ã¥±¡¼¥¸¥Ç¥£¥ì¥¯¥È¥ê¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È ¥ê¤ÈƱ¤¸¤Ê¤Î¤Ç¡¢¥³¥ó¥Ñ¥¤¥ë¤ÏŬÀڤ˹Ԥï¤ì¤Þ¤¹¡£¤¿¤À¤·¡¢¸½ºß¤É¤Î¥Ç¥£¥ì ¥¯¥È¥ê¤Ë¤¤¤ë¤«¤Ë´Ø·¸¤Ê¤¯¥Õ¥¡¥¤¥ë¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¥¯¥é¥¹ ¥Ñ¥¹¤Ë /examples ¤òÄɲ乤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Ë¥¨¥ó¥È¥ê¤òÄɲ乤ë¤Ë¤Ï CLASSPATH ¤òÀßÄꤹ¤ëÊýË¡¤â¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤³¤Ç¤Ï -classpath ¥ª¥×¥·¥ç¥ó¤ò»È¤¤¤Þ¤¹¡£

   example% javac -classpath /examples /examples/greetings/Hi.java

ºÆÅÙ greetings.Hi ¤òÊѹ¹¤·¡¢¥Ð¥Ê¡¼¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»È¤¦¤è¤¦¤Ë¤·¤¿¾ì¹ç ¤Ï¡¢¤³¤Î¥Ð¥Ê¡¼¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤â¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤òÄ̤¸¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë ¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

   example% javac -classpath /examples:/lib/Banners.jar \
                     /examples/greetings/Hi.java

greetings Æâ¤Î¥¯¥é¥¹¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢greetings ¤È¡¢greetings ¤¬»È¤¦ ¥¯¥é¥¹¤ÎξÊý¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

   example% java -classpath /examples:/lib/Banners.jar greetings.Hi

 

¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÎʬΥ

ÆäËÂ絬ÌÏ¥×¥í¥¸¥§¥¯¥È¤Î¾ì¹ç¤Ï¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÊ̤Π¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤¯¤ÈÊØÍø¤Ê¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¥¯¥é¥¹¥Õ¥¡¥¤¥ë½ÐÎÏÀè¤òÊÌ¸Ä¤Ë »ØÄꤹ¤ë¤Ë¤Ï¡¢ -d ¤ò»È¤¤¤Þ¤¹¡£¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤¬¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Ë¤Ï¤Ê¤¤¤Î¤Ç¡¢ -sourcepath ¤ò»È¤Ã¤Æ¡¢¥³¥ó¥Ñ¥¤¥é¤¬¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤· ¤Þ¤¹¡£

   example% ls
      classes/  lib/      src/
   example% ls src
      farewells/
   example% ls src/farewells
      Base.java      GoodBye.java
   example% ls lib
      Banners.jar
   example% ls classes
   example% javac -sourcepath src -classpath classes:lib/Banners.jar \
      src/farewells/GoodBye.java -d classes
   example% ls classes
      farewells/
   example% ls classes/farewells
      Base.class      GoodBye.class

¥³¥Þ¥ó¥É¹Ô¤Ç¤Ï src/farewells/Base.java ¤ò»ØÄꤷ¤Æ¤¤¤Þ¤»¤ó¤¬¡¢¤³¤Î ¥Õ¥¡¥¤¥ë¤â¥³¥ó¥Ñ¥¤¥é¤Ë¤è¤Ã¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ ¼«Æ°¥³¥ó¥Ñ¥¤¥ë¤ò¥È¥ì¡¼¥¹¤¹¤ë¤Ë¤Ï¡¢ -verbose ¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£

 

¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¤ÎÎã

¤³¤³¤Ç¤Ï¡¢JDK 1.2 javac ¤ò»È¤Ã¤Æ 1.1 VM ¾å¤Ç¼Â¹Ô¤¹¤ë¥³¡¼¥É¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£

   example% javac -target 1.1 -bootclasspath jdk1.1.7/lib/classes.zip \
        -extdirs "" OldCode.java

-target 1.1 ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê¡¢À¸À®¤µ¤ì¤ë¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤¬ 1.1 VM ¤Ë¸ß´¹À­¤¬¤¢¤ë ¤³¤È¤¬Êݾڤµ¤ì¤Þ¤¹¡£JDK1.2 ¤Ç¤Ï¡¢ javac ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç 1.1 ¤Ø¤Î¸ß´¹À­¤ò°Ý»ý¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤ò¹Ô¤¦¤Î¤Ç¡¢¤³¤Î ¥ª¥×¥·¥ç¥ó¤Ï¸·Ì©¤Ë¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£¤¿¤À¤·¡¢¥³¥ó¥Ñ¥¤¥é¤Ë¤è¤Ã¤Æ¥Ç¥Õ¥© ¥ë¥È¤¬°Û¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë½¬´·¤ò¤Ä¤±¤Æ ¤ª¤¯¤È¤è¤¤¤Ç¤·¤ç¤¦¡£

JDK 1.2 javac ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢1.2 ¤Î¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¥¯¥é¥¹¤ËÂФ·¤Æ¥³¥ó¥Ñ¥¤¥ë¤ò¹Ô¤¦ ¤Î¤Ç¡¢JDK 1.2 ¤Ç¤Ï¤Ê¤¯ JDK 1.1 ¤Î¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¥¯¥é¥¹¤ËÂФ·¤Æ¥³¥ó¥Ñ¥¤ ¥ë¤ò¹Ô¤¦¤è¤¦¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¡¢ -bootclasspath ¤ª¤è¤Ó -extdirs ¤ò»È¤Ã¤Æ¹Ô¤¤¤Þ¤¹¡£¤³¤Î»ØÄê¤ò¹Ô¤ï¤Ê¤¤¤È¡¢1.1 VM ¤Ë¤Ï¸ºß¤·¤Ê¤¤ 1.2 API ¤ËÂбþ¤·¤¿¥³¥ó¥Ñ¥¤¥ë¤¬¹Ô¤ï¤ì¤ë¤¿¤á¡¢¼Â¹ÔÃæ¤Ë¾ã³²¤¬È¯À¸¤¹¤ë²Ä ǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£

 

´ØÏ¢¹àÌÜ

jar(1)¡¢ java(1)¡¢ javadoc(1)¡¢ javah(1)¡¢ javap(1)¡¢ jdb(1)

¼¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢Java ¤Î Web ¥µ¥¤¥È¤ò»²¾È¤Þ¤¿¤Ï¸¡º÷¤·¤Æ¤¯¤À¤µ¤¤¡£

Java ³ÈÄ¥µ¡Ç½µ¡¹½ @
http://java.sun.com/j2se/1.3/ja/docs/ja/guide/extensions/index.html (http://java.sun.com/j2se/1.3/docs/guide/extensions/index.html ¡§±Ñ¸ìÈÇ)


 

Index

̾Á°
·Á¼°
¥Ñ¥é¥á¡¼¥¿
µ¡Ç½ÀâÌÀ
·¿¤Î¸¡º÷
¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È
¥ª¥×¥·¥ç¥ó
ɸ½à¥ª¥×¥·¥ç¥ó
¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥ó
Èóɸ½à¥ª¥×¥·¥ç¥ó
Îã
´Êñ¤Ê¥×¥í¥°¥é¥à¤Î¥³¥ó¥Ñ¥¤¥ë
Ê£¿ô¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Î¥³¥ó¥Ñ¥¤¥ë
¥æ¡¼¥¶¥¯¥é¥¹¥Ñ¥¹¤Î»ØÄê
¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÎʬΥ
¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë¤ÎÎã
´ØÏ¢¹àÌÜ

This document was created by man2html, using the manual pages.
Time: 04:36:37 GMT, November 10, 2024