This post shares many tools we found during our working experience in many Java projects. All of them are free, and many of them are the must tools in all Java projects of my team. These tools will make your life easier and more productive if you must work on a Java project
Now, let take a look at them:
We know there are many options like Eclipse or NetBeans, but IntelliJ is the only IDE we suggest to any Java developer. Eclipse IDE becomes slower and slower after we upgrade to the new version, and it is worse if you have many installed plugins. We just use Netbeans for around 1 hour before deciding to continue using IntelliJ, the Netbeans build process is simply so slow and their IDE seems not very friendly in case we are moving from IntelliJ.
IntelliJ has enough plugins for our usages. It does not have many plugins like the Eclipse marketplace, but the quality of plugin is very high. It has enough plugins for our needs:
- Code quality: Findbugs, CMD, Checkstyle besides it supports for code quality is good as well
- Build tool: Maven, Ant, Play, Gradle.
- Testing: JUnit, Test-NG
- and more useful plugins such as JRebel, JProfiler
We have used Maven from 7 years ago, and until now it is the main build tool of MyCollab product. Maven runs well in IntelliJ IDE, and standalone application in our continuous integration server Hudson, and Travis CI. The advantages of Maven is helping standard your build process, and you must follow the Maven rules, they are Maven’s life cycles and the project structures. Fortunately, we have no problem to follow Maven rules and we have all plugins to check source quality, testing and deliver the product builds.
The major drawbacks of Maven we faced in our works are:
- The big XML files if we have many dependencies and build process.
- Simple task requires a lot of lines, such as copy the dependencies to the output folder
- Multi-module architect still has issues. For instance, it takes us a lot of time to maintain the Maven outputs for 3 different kinds of output: Open source, Premium or Cloud edition.
We do not have any problem not overcome with Maven, for the existing Maven project you should still keep using until you are not happy with its performance.
Gradle is our next favorite build tool. It is easy to use, simple and does as developers’ brain. We do not have much constraints like Maven does. In addition, the build file is dramatic shorter. We choose Gradle for our new projects recently over Maven, and we do not regret. Its speed, convention-over-configuration, Groovy based language are the advantages compare to Maven. Bonus point: IntelliJ supports Gradle really well.
The most impressive and until now I do not find any alternative tool. If we do not choose IntelliJ, we can accept to work with Eclipse. If we do not have Gradle tool, it is fine if we use Maven or Ant to build our project. But we can not find the alternative as good as JRebel.
Someone do not know JRebel, are you? But as a Java developer, you have to the needs of reloading Java codes during runtime. If you are working on a web project, the scripts are JSP or Groovy can detect the changes and rebuild the project. But almost cases, you are working on Java sources, JRebel helps your project can reload code changes during runtime. Does it sound interesting? If you are working on the development machine and you want to test the code changes without restarting the server, JRebel can save your development time hundreds of hours per year without interrupting their jobs while restarting the server.
2016-06-16 02:20:19 JRebel: Reloading class 'com.esofthead.mycollab.module.project.view.settings.ProjectMemberListViewImpl$5'.
2016-06-16 02:20:19 JRebel: Reloading class 'com.esofthead.mycollab.module.project.view.settings.ProjectMemberListViewImpl$1'.
2016-06-16 02:20:19 JRebel: Reloading class 'com.esofthead.mycollab.module.project.view.settings.ProjectMemberListViewImpl'.
2016-06-16 02:20:19 JRebel: Reloading class 'com.esofthead.mycollab.module.project.view.settings.ProjectMemberListViewImpl$2'.
There are several Java profile tools. They are JProfiler, YourKit, AppDynamics or even the free VisualVM. Performance, memory efficiency are the important factors in MyCollab product, and choosing the right profiler tool is the task we did carefully. JProfiler is the winner for their clear UI, integrating well with IntelliJ and they sponsor the free license for the open source product.
JProfiler helps us to measure the memory efficiency, database connections, threads usage etc. We do not need to read any user guide to start using JProfiler.
Do we need to write any description for JUnit, Mockito but they are the must-have tools in our development team. JUnit is used to write the plain unit test to verify your functionalities, and we use it in the database testing as well. We use Mockito to write the mock objects in the integrating testing such as writing test cases for servlet, or file access simulation.
But do you hear about the AssertJ? This tool also belongs to our toolkit in all Java projects. We face the problem how to let our unit tests readability, also verify the detail return result. For instance, it takes the effort to verify whether an element in a collection has the set of attributes meet some criteria.
For instance, it takes the effort to verify whether an element in a collection has the set of attributes meet some criteria. The first problem is we can not guarantee the order of collections per machine, the second problem is getting the object attributes require the team writes the boilerplate codes. AssertJ is the toolkit helps your task easier
List projects = projectService.findPagableListByCriteria(new BasicSearchRequest<>(criteria, 0, Integer.MAX_VALUE));
assertThat(projects).extracting("id", "name").contains(tuple(1, "A"),
tuple(2, "B"), tuple(3, "C"), tuple(4, "D"));
Findbugs is our favorite tool for many years. It integrates well with the IntelliJ, Maven, or Jenkins server. Thank you for its help to analyze the source code quality to let us improve the quality of source codes.It is easy to run and produce a good result.
This tool is also our favorite one for many years. It takes you 5 minutes to install, and if your project uses Ant, Maven or Gradle then you are able to make the automation build in minutes. It integrates really well with all SCM like Git, Mercurial, SVN and the old CVS. It also produces the reports for build result, source code quality (Findbugs, Checkstyle, PMD etc), testing (JUnit, Test coverage tools)
Relate to the continuous integration server, and source code quality my team recommend the SonarQube tool that automates analysis source code and post the result to the Jenkins server. You can integrate SonarQube in your Maven or Gradle build files by several lines of codes.
Above are 8 productive tools for Java developers cover all activities of your jobs: IDE, build process, testing, analysis code quality, continuous integration tool, profiler and assistant toolkit. If you know any excellent tools outside this list, please put the comment below.