Alex Marshall Alex Marshall is a marketeer, web developer and designer. He also likes retro technology, classic cars and in his spare time enjoys travelling.

Are you a Java Developer working with PDF files?

Find out why you should be using JPedal

5 tools to help you write better Java Code

3 min read

At IDR Solutions we are always looking at ways to improve our Java PDF Library and our PDF to HTML5 Converter. The best way to do this is to improve the Java Code we write, we do this using some useful tools that help to not only improve our code but also our productivity.

In this article, we will be taking a look at the 5 most used tools that we use at IDR Solutions and how they can help Java developers write better code. I have also written a follow-up article aimed at a more specific area which is 9 tools to help you with Java Performance tuning.

FindBugs

umdFindbugsFindBugs is an open-source program that is distributed under the terms of the Lesser GNU Public license and operates on Java bytecode rather than source code.

The tool uses static analysis to help identify hundreds of different potential types of errors in the code of Java programs, these include null pointer dereferences, infinite recursive loops, bad uses of the Java libraries and deadlocks.

FindBugs is mainly used for identifying hundreds of serious defects in large applications. It is capable of determining the severity of potential errors and is classified into four ranks:

  1. scariest
  2. scary,
  3. troubling
  4. of concern.

FindBugs is distributed as a stand-alone GUI application and also as plug-ins for Eclipse, NetBeans, IntelliJ IDEA and Findbugs can be used from the command line or within ant, eclipse, maven, NetBeans and emacs.

Apache Ant

200px-Apache-Ant-logo.svg<a< span=””> href=”http://ant.apache.org/”>Apache Ant is an Apache project and it is open-source software and is released under the Apache Software License.  Apache Ant uses XML and is a useful tool for the automation of software build processes and is implemented using Java language, requires the Java platform and mainly used for Java projects. It is also a library and a command-line tool and Ant is design with a number of built-in tasks that allow developers to compile, assemble, test and run Java applications.

Outside of Java Ant can also be used in building non-Java applications, such as C or C++ applications and in general use can be used in types of process which can be described in terms of targets and tasks.

There are a large number of ready-made commercial or open-source “antlibs” available for users and it is extremely useful as it is flexible and does not put restrictions on coding conventions or directory layouts for java projects.

Apache Ant is available for commonly used Java IDE’s such as EclipseNetBeans, and IntelliJ IDEA.

JProfiler

logo_jprofiler01

JProfiler is a commercially licensed Java profiling tool developed by EJ-technologies GmbH and is mainly designed for use with Java EE and Java SE applications.

JProfiler is a Java profiler combining CPU, Memory and Thread profiling into one application and is useful for developers as it can be used to analyze performance bottlenecks, memory leaks, CPU loads and resolve threading issues.

JProfiler is useful as it supports local profiling (analysis of applications that are running on the same machine on which the JProfiler software is installed) and remote profiling (this is where it allows for the analysis of Java applications which are running on remote machines which JProfiler software is not installed on.).

JProfiler can profile the information in both cases and allow the user to immediately see life through a visual representation showing the load in terms of active and total bytes, instances, threads, classes, and garbage collector activities.

JProfiler works both as a stand-alone application and as a plug-in for the  EclipseNetBeans, and IntelliJ IDEA and Oracle JDeveloper software development environments.

It is also available as part of application server integration in Adobes Coldfusion and Glassfish.

Bash

terminalBash is a UNIX shell, or command language interpreter, written for the GNU Project as a free software replacement for the Bourne shell.

It has been around a relatively long period of time and was released in 1989, and it has been widely distributed as a shell for GNU operating systems and as a default shell on Linux and Mac OS X. Its popularity meant It was ported to Microsoft Windows and to Android through various terminal emulation applications.

Essentially Bash is used as a command processor, typically running in a text window, and allows for type commands which cause actions. Bash can read various commands from a file, and supports filename wildcarding, piping, here documents, command substitution, variables and control structures for condition-testing and iteration.

It is particularly useful as it allows for the automation of some tasks using Bash scripts.

Sonarqube

Sonarqube-48x200

SonarQube is an open-source platform that was originally launched in 2007 under the name Sonar, and in recent years has become a world leader in code quality management systems, and is well known for its Continuous Inspection of code quality.

It currently supports 25+ languages, some of which include Java, C/C++, C#, PHP, Flex, Groovy, JavaScript, Python, PL/SQL, and COBOL, and also it is often used as part of Android development.

It is useful as it offers fully automated analysis tools and integrates well with Maven, Ant, Gradle and other continuous integration tools. It reports on duplicated code, coding standards, unit tests, code coverage, complex code, potential bugs, comments, design and architecture.

It integrates well with the Java IDE development environments such as EclipseNetBeans, and IntelliJ IDEA and is expandable with the use of plugins.

Check back next time as I will be taking a look at useful HTML and CSS tools.

What tools do you use to help improve your code, let us know!



Our software libraries allow you to

Convert PDF to HTML in Java
Convert PDF Forms to HTML5 in Java
Convert PDF Documents to an image in Java
Work with PDF Documents in Java
Read and Write AVIF, HEIC, WEBP and other image formats
Alex Marshall Alex Marshall is a marketeer, web developer and designer. He also likes retro technology, classic cars and in his spare time enjoys travelling.

Should you travel by plane or train?

Why travel to Switzerland by train This year, my daughter set me the challenge to take the train rather than fly when I next...
Mark Stephens
1 min read

One Reply to “5 tools to help you write better Java Code”

  1. ANT ? 🙂 I think that no one is using Ant anymore. Maven, Gradle – is a way to go.
    And you forgot about other important and well known code quality tools like PMD, Checkstyle etc.
    Not worth reading, anyway, but thanks for the article.

Comments are closed.