I'm trying to use the POI library on Android API 17 but I can't since I get this exception: java.lang.NoClassDefException: java.nio.charset.StandardCharsets at StringUtil.java:32 (...) StringUtil.java:32 protected static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1; Could this be changed to the following? protected static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1"); It's backwards compatible and it's not deprecated for now... If not, an API check can also be done, but that would make the library only work for Android.
POI is not supported on Android. For what I can see from issues on the POI mailing lists and on stackoverflow, users have not made much progress in getting it to work. I'm not very familiar with Android versions. https://en.wikipedia.org/wiki/Android_version_history#Android_4.2_Jelly_Bean_JOP40C_(API_17) was released in 2012 - but maybe you are referring to a newer version?
POI works almost perfectly on the latest Android versions (couldn't get XSSF to work, but HSSF does, and flawlessly). But my client asked to make my project backwards compatible to Android 4.2 (API 17, indeed released on 2012). The thing is, the StandardCharsets class was added (probably ported from vanilla Java) later to API 19... There are many references to this class all over the code. If I can't get this issue to be resolved, I'll probably get POI's source code and build it myself with the changes I need...
Closing - as we don't intend latest POI versions to support really old Android releases.
It might be worth trying POI 3.17 which supported older versions of Java.