Java

General-purpose, object-oriented and concurrent computer programming language.

Java build tools

The most popular build tools used by millions of Java developers are packaged in official Fedora repositories. This page contains information on how easy it is to install them.

Maven installation

Maven is probably the most popular build tool in Java world these days. To install it, simply type:

$ sudo dnf install maven

Gradle installation

Gradle is another popular tool used not only for building Java projects. To install it, simply type:

$ sudo dnf install gradle

Ant+Ivy installation

Last but not least, still quite popular duo Ant+Ivy can be installed simply by typing:

$ sudo dnf install ant apache-ivy

DevAssistant is obsolete, use it for reference only

You can get started with Maven by using DevAssistant to create a simple project, simply type (after you have DevAssistant setup and installed):

da --debug crt java maven -n Dev_Sample

The project that is created (Example: Dev_Sample), roughly follows the Maven Project Structure but does not contain all of the directories or files. Initially you should see 2 directories (src and target) when you explore the project directory. You will also notice that your project directory has a file, the pom.xml in it, this is your Maven project file that defines your build, and how you will transition through the Maven build lifecycles.

The target directory is created as part of your initial project build, triggered by DevAssistant command above. This directory is where your compiled artifacts, or generated outputs (from builds) are stored. Its best to think of this directory as a temp space, used to store the outputs from a build.

  • Note: if you run git status in the created Dev_Sample directory, you will see that the target directory is not part of your git repository. Its a best practice to not include this in your version control system, so its recommended that you create a gitignore file, add this directory and anything under it as ignored files.

The src directory, is the start of your source directory structure, and under this directory you will see typically see any number of package directories(Example: main), and the template testing framework (using junit).

The sample application created, as part of the DevAssisttant project creation, creates a single application (jar) from the main.java.org.devassistant.maven.Main class. It also creates a single test (test if a boolean is true), that is run when a build happens.