Writing

  • Maven build error: “Caused by: java.io.IOException: Incompatible version 1007”

    I was encountering this error in Jenkins when it tried to build a project I was working on: Caused by: java.io.IOException: Incompatible version 1007. at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127) at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107) at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87) at org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:134) at org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:107) The problem was due to a breakage/bug in the jacoco-maven-plugin. To fix, simply add a version in your pom.xml, like so:…

  • Seven performance metrics for Java applications

    I came across this in this blog post and am adding it here as a checklist. It’s a worthwhile list to have so you can understand how your Java app behaves in production. Response times and throughput Load Average Error Rates (and how to solve them) GC rate and pause duration Business Metrics Uptime and service…

  • Maven Error: “Bare Repository has neither a working tree, nor an index”

    I suddenly couldn’t build a Maven project at work because of the error below…. Did some googling but didn’t really find helpful info, other than that I was touching a “bare” repository. I thought about it for a second and realized that maybe my changing the artifact version in the pom had something to do with it…

  • My custom bash prompt

    ,

    I wanted more information in my bash prompt, such as date/time and the directory I was in.  Here’s what it looks like: And this is what I added in my ~/.bash_profile: PS1='${debian_chroot:+($debian_chroot)}\d \T > \[$(tput sgr0)\]\[\033[01;32m\]\u@\h\[\033[00m\] : \[\033[01;34m\]\w\[\033[00m\]\n\$ ' Run source ~/.bash_profile and enjoy. 🙂 BTW, there’s also a website that you can use to…

  • Unpretty print a JSON file

    , ,

    I needed a one-liner JSON payload, but only had the pretty-printed version. And, removing the whitespaces manually was NOT an option. It was super easy on a Mac; just do the following: In a terminal, install “jq” with brew like so brew install jq With your pretty-printed JSON in a file: cat prettyprinted.json | jq…

  • Switching between multiple Java versions on OS X quickly

    If you’re a Java developer like me, you will need to work on various Java versions. If so, adding the following in your ~./bash_profile makes switching between versions a snap. (As of this writing, I’m running on OS X El Capitan.) alias java6='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6);java -version' alias java7='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7);java -version' alias java8='export…