Zookeeper source Learning 1:win7 under ant compiler zookeeper source code for Eclipse project

Source: Internet
Author: User
Tags zookeeper

1. What is Ant???

Apache Ant?

Apache Ant is a Java library and command-line tool whose mission are to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of ANT is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also is used effectively to build non Java applications, for instance C or C + + applications. More generally, Ant can is used to pilot any type of process which can is described in terms of targets and tasks.

Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and is offered a large number of ready-made Commercial or Open-source "Antlibs".

Ant is extremely flexible and does no impose coding conventions or directory layouts to the Java projects which adopt it As a build tool.

Software development projects looking for a solution combining build tool and dependency management can use ANT in Combina tion with Apache Ivy.

The Apache Ant Project is part of the Apache software Foundation.


Apache Ant, a tool for automating software compilation, testing, deployment, and more, is mostly used for software development in Java environments. Provided by the Apache Software Foundation.
Anyone who has ever used a Linux system should know to make this command. This command is often used when compiling the Linux kernel and some of the software's source programs. The make command is actually a project management tool, and ant implements the same functionality. The compiler tools like Make,gnumake and NMAKE have some flaws, but ant overcomes the pitfalls of these tools. Initially, ant developers developed cross-platform applications that were also designed to be better for ant based on these flaws.

The core of ant is its build file, and when you start a new project, you should first write the ant build file. The build file defines the build process and is used by everyone in the team development. The ant build file is named Build.xml by default, or it can take other names. Just pass the name as a parameter to ant at run time. The build file can be placed in any location. The general practice is to put it in the top-level directory of the project. This will keep the project concise and clear. The following is a typical project hierarchy.
(1) src deposit file.
(2) class holds the compiled file.
(3) Lib holds third-party jar packages.
(4) Dist Storage package, post code.

Learn more about Ant and you can search by yourself.


2. Install Ant

(1) Download ant, I downloaded the apache-ant-1.9.4-bin.zip (address: http://ant.apache.org/bindownload.cgi)

(2) Extract to a specific directory, set Ant_home (ANT's decompression path) and path (%ant_home%\bin)

(3) Open cmd, run ant-version, the version information indicates that the installation was successful.


3, download zookeeper source code and use ant to compile the Eclipse project

Zookeeper GitHub is: https://github.com/apache/zookeeper

Unzip, open cmd, switch to the root directory of the zookeeper source (there is a build.xml file below), then enter the command > Ant eclipse

The following interface prompts the compilation to succeed:



Then open Eclispe, whatever version, choose Import, type is the existing Eclispe project.



Click Done, but found that my source has several errors, but the type is the same, are cannot switch on a value of type XXX:



On the web, it's about the JDK version that the project file uses to compile, and you need to switch JDK 7 to JDK 6:

In the imported Zookeeper project, right click-"properties-" Java Compiler, the Compiler compliance level switch to 1.6:



This error will disappear, the following can start to enter the real zookeeper source of the tour!


Zookeeper source Learning 1:win7 under ant compiler zookeeper source code for Eclipse project

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.