Workaround to prevent NoClassDefError with java 1.8