Apache POI Introduction
What is Apache POI?
Apache POI is the open source Java library for Microsoft Office formats. The components you will use most are HSSF/XSSF (Excel .xls/.xlsx), HWPF/XWPF (Word .doc/.docx) and HSLF/XSLF (PowerPoint). This tutorial focuses on Excel, the 90% use case: reports, exports, imports and data migration.
HSSF vs XSSF vs SXSSF
- HSSF — old binary
.xls(max 65,536 rows). Legacy only. - XSSF — modern
.xlsx(OOXML). Default choice; whole workbook lives in memory. - SXSSF — streaming writer for huge
.xlsxfiles; keeps only a sliding window of rows in memory.
poi vs poi-ooxml
The poi artefact covers the old binary formats; poi-ooxml adds the XML-based .xlsx/.docx support (plus xmlbeans and friends transitively). For new projects declare poi-ooxml — it pulls in poi automatically.
What You Will Build
Every lesson has runnable code in the companion poi-examples repo: writing workbooks, reading them back, styling, formulas, and a million-row streaming export.