casclicks.blogg.se

Installign apache ant
Installign apache ant





installign apache ant

Here, we used a RHEL/CentOS 7 machine, but the same build.xml file can be used to compile and build our Java application on any other platform.Apache Ant is distributed under the Apache Software License which is a fully-fledged open source license certified by the open source initiative. We have successfully compiled and build our Java application by using Apache ANT commands. Building jar: /root/TestApp/build/jar/test.jar Compiling 1 source file to /root/TestApp/build/classes Created dir: /root/TestApp/build/classes # vi build.xmlĭefine some basic Targets and Tasks therein. Now, we will compile the same application by using Apache ANT commands.Ĭreate an Apache ANT Build File build.xml for our project. We have successfully compiled our Java code and then build a JAR file by using Java commands. # jar cvfm build/jar/test.jar mymanifest -C build/classes/. # echo "Main-Class:test.TestApp" > mymanifestĬreate a JAR file now.

installign apache ant

To create a JAR, we need to create a JAR manifest for our Java Project. Since, our application is running fine, we can now create a JAR file from compiled classes. # javac -sourcepath src -d build/classes src/test/TestApp.java ("Testing Apache Ant.") Ĭompile TestApp.java and check for any possible errors. # vi src/test/TestApp.javaĪnd write some Java code here. # cd TestAppĬreate a file in src/test directory. TestApp.īuild/classes directory is used for place the compiled Java classes.īuild/jar directory is used to generate JAR (Java Archive) from the compiled Java classes.Ĭheck the directory structure.

installign apache ant

Src/test directory is used for keeping the source code of our Java Application i.e. Let's create required directory structure for our project. We will first create a simple Java application and then compile and build the JAR by using Java commands. # yum install -y antĪpache ANT requires Java Development Kit (JDK) therefore, it has installed the available version of OpenJDK from yum repository. Install Apache ANT package with yum command.

  • Operating System - Red Hat Enterprise Linux (RHEL) 7.6Ĭonnect to using ssh.
  • We are using a Linux machine with following specification. In this article, we will install Apache ANT on RHEL/CentOS 7 machine and create a build.xml file to compile and build a simple Java application.Īpache ANT does not have any special system requirements. The same build.xml file can be used on any platform to build the Java application. It uses a XML file build.xml to create script for the build process. It is mostly used by open source community to compile and build Java applications.

    installign apache ant

    Apache ANT (Another Neat Tool) is a Java Library and Command-line tool to automate software build processes.







    Installign apache ant