본문 바로가기

HaDoop...?

JDK, ANT 설치

Hadoop의 소스를 고치고 컴파일 하려면 JDK와 ANT가 필요하다.

JDK 설치 방법.


1. JDK 다운로드 (필자는 JDK_6 version 사용)

http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html

-> Linux 버전에 맞는 파일 다운 (필자는 jdk-6u33-linux-x64.bin 다운)


파일 이동

mv /root/Desktop/jdk-6u33-linux-x64.bin /usr/local/


권한 부여

chmod 755 jdk-6u33-linux-x64.bin


설치

./jdk-6u33-linux-x64.bin


설치중...

Java(TM) SE Development Kit 6 successfully installed.

Product Registration is FREE and includes many benefits:

* Notification of new versions, patches, and updates

* Special offers on Oracle products, services and training

* Access to early releases and documentation

Product and system data will be collected. If your configuration

supports a browser, the JDK Product Registration form will

be presented. If you do not register, none of this information

will be saved. You may also register your JDK later by

opening the register.html file (located in the JDK installation

directory) in a browser.

For more information on what data Registration collects and

how it is managed and used, see:

http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html

Press Enter to continue.....

[Enter] 누르면 Done 뜨고 설치 완료.


환경 변수 설정

vim /etc/profile

맨 아래에다가

export JAVA_HOME=/usr/loca/jdk1.6.0_33

export PATH=$PATH:$JAVA_HOME/bin

export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/tools.jar

:wq (저장 후 종료)

source /etc/profile (설정 변경 적용)


java -version 해서 1.6.0_33 뜨면 성공!

jps 해서 프로세스 뜨면 성공!



2. ANT 설치 

Hadoop은 hadoop home에 build.xml이 존재한다. 이는 ANT를 이용해서 컴파일이 가능하다.

http://ant.apache.org/bindownload.cgi

에서 아래 tar.gz 아카이브 다운


파일 이동

mv /root/Desktop/apache-ant-1.8.4-bin.tar.gz


압축 해제

tar xvfz apache-ant-1.8.4-bin.tar.gz


환경 변수 설정

vim /etc/profile

JDK 설치시 설정한 환경변수 export JAVA_HOME 밑에

export ANT_HOME/usr/local/apache-ant-1.8.4 (추가)

PATH 변경 

export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin

CLASSPATH는 놔둔다.

:wq (저장 후 종료)

source /etc/profile (설정 변경 적용)


결국 모두 설정된 /etc/profile 모습

export JAVA_HOME=/usr/local/java

export ANT_HOME=/usr/local/ant

export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin

export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/tools.jar



ant -version 해서 1.8.4 뜨면 성공!

혹시 모르니 java -version 도 다시 해보시길. 둘다 잘 동작 되야됨.



다음 포스팅은 hadoop 코딩 환경 및 컴파일 해보기