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. 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. Apache ANT (Another Neat Tool) is a Java Library and Command-line tool to automate software build processes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |