컴퓨터 엑셀 워드 포토샵 구글어스 WINDOWS JAVASCRIPT JAVA C++

 
Monday, August 28, 2006

자바] javac (자바 컴파일러; javac.exe) 실행법; 패스 추가


자바를 설치한 후, 일명 도스창(정식 명칭은 '명령 프롬프트')에서 자바를 실행하면, 자바 컴파일러인 javac 가 실행되지 않습니다.

'javac'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는
배치 파일이 아닙니다.

이렇게, 윈도우가 javac 를 찾지 못한다는 에러가 납니다.



javac.exe 는 이런 폴더에 있습니다: D:\Program Files\Java\jdk\bin
(위의 경로는 자바를 D:에 설치하고 jdk에서 버전 번호를 제거한 경우.
J2SE(TM) Development Kit 5.0 Update 8 의 기본 설치 폴더는
C:\Program Files\Java\jdk1.5.0_08이것임)

따라서
D:\Program Files\Java\jdk\bin
이 경로를, 윈도우의 패스에 지정해 주면 됩니다.
(또는 버전에 따라 C:\Program Files\Java\jdk1.5.0_08\)

▶▶ 윈도우XP] 기존의 패스(Path) 환경변수에, 새 경로(디렉토리; 폴더) 추가하는 법 참조.




저의 경우에는 패스 문자열이 이렇게 되었습니다.

추가 직전:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\cygwin\bin;D:\WINDOWS_\Path;D:\Perl\bin


추가 직후:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\cygwin\bin;D:\WINDOWS_\Path;D:\Perl\bin;D:\Program Files\Java\jdk\bin



패스를 수정하고 나서, 도스창(명령 프롬프트창)을 종료하고 다시 시작한 후,

이제 javac 라고 치면 다음과 같이 실행이 됩니다.
D:\Z>javac
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are u
sed
  -classpath <path>          Specify where to find user class files
  -cp <path>                 Specify where to find user class files
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -d <directory>             Specify where to place generated class files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release

  -target <release>          Generate class files for specific VM version
  -version                   Version information
  -help                      Print a synopsis of standard options
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system


D:\Z>





▶▶ [Java] 자바 런타임과 JDK(개발도구; 컴파일러) 파일 다운로드하는 곳은? / 자바의 종류는? [QnA]




tag: java
자바 | Java

0 Comments:

Post a Comment

<< Home RSS 2.0 feed

구글 Google 에서 제공하는 무료 블로그 서비스인 블로거 Blogger 의 인터넷 주소는 www.blogger.com 입니다. Blogger 에 블로그를 만들면, blogspot.com 이라는 주소에 블로그가 생성됩니다.
블로그를 직접 방문하지 않고도 최신 게시물을 구독하려면 RSS 2.0 feed 주소를 리더기에 등록하시면 됩니다.
Previous Posts
Monthly Archives
Top