본문 바로가기
카테고리 없음

[Eclipse] Ant 실행시 'Perhaps JAVA_HOME does not point to the JDK.'

by 버들도령 2019. 6. 16.
728x90

[Eclipse] Ant 실행시 'Perhaps JAVA_HOME does not point to the JDK.'

Eclipse에서 Ant로 빌드시에 다음과 같은 에러가 발생한다면?

--> 현재 설정되어 있는 java관련 라이브러리 디렉토리가 올바르지 않거나, tools.jar 라이브러리가 존재하지 않는 경우.

이런 경우 JDK_HOME.. 보통 C:\Program Files\Java\jdk1.xxx\lib 디렉토리 혹은 C:\Program Files\Java\jre7 디렉토리에 tools.jar 가 없는 경우이므로 정상적으로 jdk를 설치한 경우라면 tools.jar 라이브러리를 External Jar 로 포함시켜준다.

방법은? 
Eclipse Main Menu > Window >  Preferences > Ant > Runtime > Classpath tab > Ant Home Entries > Add External JARs... > C:\Program Files\Java\jdk1.xxx\lib\tools.jar 선택 추가

------------------------------------------------------------------------------------------------------------

Buildfile: C:\MyWork\workspace\Server\build.xml
build-prepare:
compile:
    [javac] C:\MyWork\workspace\Server\build.xml:61: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

BUILD FAILED
C:\MyWork\workspace\Server\build.xml:61: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre7"

Total time: 953 milliseconds 

728x90

댓글