Java code has the big advantage of being very portable.

Installing Compilers and Runtimes

Its recommended to use the latest official Oracle version (Java 8) if at all possible. OpenJDK is usually ok as well, but definitely avoid gcj.

Editors and IDEs

For Java we normally use the Eclipse IDE.

Coding style conventions

We follow the standard coding style defined by SUN.

Latest version seems to be the Java Coding Style on Scribd.

We have standard code formatting settings for eclipse.

TODO: describe tabs-vs-spaces and indentation size.

code_format_nlesc_v2.xml code_cleanup_nlesc.xml

Automated checking of the code style can be done with PMD and FindBugs.`

TODO: add (a link to) our standard ruleset.

Building and packaging code

As a build system we normally use Gradle. This also determines the project layout, and has standard features for packaging code.


The standard unit testing framework in Java is JUnit. Try to use Junit 4 if at all possible.

Use following naming scheme to distinguish unit and integration tests:

  • Unit tests: /Test*.java, /, and **/
  • Integration tests: /IT*.java, /, and **/

Test coverage can be measured with Jacoco. For running and viewing Jacoco code coverage, use eclemma

Code quality analysis tools and services


SonarQube is an open platform to manage code quality which can also show code coverage and count test results over time. SonarQube can analyze Java, C, C++, Python and Javascript. The analysis can be done in IDE or command line using For example project see Notifications of each project must be configured in your own account settings.


Code quality and coverage grouped by file. Can setup goals to improve quality or coverage by file or category. For example project see


Can show code coverages for many languages including Java, Python and Javascript. Shows unified coverage and separate coverage for matrix builds. For example project see

Debugging and Profiling

Use jConsole or jVisualVM.


For logging, we use the slf4j api. The advantage of slf4j is that it is trivial to change logging implementations. The API distribution also contains a few simple implementations.

To get logging info into Eclipse, one option is to use logback beagle.

Writing documentation

Java has the inbuild JavaDoc system for generating API documentation, usually in the form of HTML. Highly recommended.

JFreeChart is a Java library that allows to do nice looking charts.

Available Templates

There are currently no Java templates available. See The Xenon repo on GitHub as a (rather complex) example.


We use Bintray to publish packages.

To make the package easy for users to install, the packages can be added to JCenter. JCenter is the largest repository in the world for Java and Android OSS libraries, packages and components. In a Gradle build file the JCenter repository can be used by adding:

repositories {

Packages developed at the Netherlands eScience Center can be found in the Bintray NLeSC repository.

results matching ""

    No results matching ""