본문 바로가기

Louis

MacOS Apache Ant 설치하기

2020-02-29 (수정 2022-10-15) · 읽는 시간 1

MacOS Apache Ant 설치하기

Ant는 Homebrew를 사용하면 쉽게 설치할 수 있다.

그리고 Java Runtime에 따라서 설치해야 하는 버전이 다르다.

Ant 최신 버전 설치하기


  • Apache Ant 1.10.x 버전은 Java8 런타임용이다.
# Install ant
$ brew install ant

# Verify ant installation
$ ant -v
Apache Ant(TM) version 1.10.7 compiled on September 1 2019
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed

Java5용 Ant 설치하고 사용하기


  • Java5 버전에서 동작하는 코드를 빌드하려면 필요하다.
  • Ant 1.9.x 버전은 Java5 런타임용이다.
# Search ant package
$ brew search ant
ant ant@19 ...

# Install ant for 1.9.x
$ brew install ant@19

# Add alias for ant 1.9.x activation
$ echo 'alias ant19="export PATH=/usr/local/opt/ant@1.9/bin:$PATH"' >> ~/.zshrc

# Turn on ant 1.9.x
$ ant19

# Verify ant 1.9.x activation
$ ant -v
Apache Ant(TM) version 1.9.14 compiled on March 12 2019
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed

참고