Add Java JDK 8 Support to Confluence 5.6.1

Since the release of Atlassian Confluence 5.7, Java JDK 8 is officially supported. However, legacy versions of Confluence, in this particular case, version 5.6.1 is only officially supported through Java JDK 7.  From my reading only supported through Java JDK 7 Build 75. From java 7u767 and Java 8 onward, -Xloggc no longer accepts filenames with a “:” in it.  The setenv.sh in the Confluence bin directory uses -Xloggc with an argument calculated from “date +%F_%T” which turns into a filename containing “:“. If attempting to run a version of Confluence prior to version 5.7, the service does not start. There is a fix for this, and it took me nearly two years to find it.  Hopefully, this will help someone else along the way.

There is a forum which offered several work-a-round solutions, while all offered merit, I ended up using a piece from a newer version of Confluence.  Basically, I commented out the original, offending line as a means for backout. Then copied the line found in the setenv.sh file from Confluence 5.9.x.

#CATALINA_OPTS="$CATALINA_OPTS -Xloggc:$LOGBASEABS/logs/gc-`date +%F_%T`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M"
CATALINA_OPTS="$CATALINA_OPTS -Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M"

After saving the setenv.sh file, pointing the Confluence instance to Java JDK 8, then restarting the server, Confluence started and runs as anticipated.  The screenshot below is from the System Information page from the Confluence Admin menu.

confluence-561-jdk8

Source(s)
http://bugs.java.com/view_bug.do?bug_id=7164841
https://jira.atlassian.com/browse/CONF-36236