Why FastExcel Is the Next‑Gen Java Excel Library After EasyExcel’s Sunset
The article announces EasyExcel's shift to maintenance mode, introduces its successor FastExcel with high‑performance features, and provides detailed migration steps, dependency configurations, and code examples for reading and writing Excel files in Java.
On November 6, Alibaba's Java Excel library EasyExcel announced it will stop adding new features and enter maintenance mode, fixing bugs only.
EasyExcel is known for fast, concise processing and low memory usage, e.g., reading a 75 MB file (460 k rows, 25 columns) with 16 MB memory in 23 seconds.
It has over 30k stars and 7.5k forks on GitHub, with more than 3,000 closed issues over six years.
Good news: the author created a new project, FastExcel.
FastExcel is open‑source under the MIT license, fully compatible with EasyExcel, and can be adopted by simply changing the Maven/Gradle dependency.
All EasyExcel features are supported.
Migration requires only package name and dependency changes.
Provides additional innovations and improvements.
Version 1.0.0 adds reading specific rows and converting Excel to PDF.
Key characteristics of FastExcel include high‑performance read/write with low memory consumption, a simple intuitive API, and stream‑based processing for massive datasets.
To use FastExcel, add the dependency:
<dependency>
<groupId>cn.idev.excel</groupId>
<artifactId>fastexcel</artifactId>
<version>1.0.0</version>
</dependency>Or for Gradle:
dependencies {
implementation 'cn.idev.excel:fastexcel:1.0.0'
}Migration steps:
1. Change dependency
Replace EasyExcel dependency with FastExcel dependency as shown.
<!-- easyexcel dependency -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>xxxx</version>
</dependency> <!-- fastexcel dependency -->
<dependency>
<groupId>cn.idev.excel</groupId>
<artifactId>fastexcel</artifactId>
<version>1.0.0</version>
</dependency>2. Change imports
Replace EasyExcel package imports with FastExcel imports.
// replace easyexcel package with FastExcel
import com.alibaba.excel.**; import cn.idev.excel.**;3. Directly depend on FastExcel without code changes
You can add FastExcel alongside EasyExcel, but long‑term replacement is recommended.
4. Prefer FastExcel classes
FastExcel classes retain EasyExcel classes for compatibility but new features will appear only in FastExcel.
Simple example to read an Excel file:
// implement ReadListener
public class DemoDataListener implements ReadListener<DemoData> {
@Override
public void invoke(DemoData data, AnalysisContext context) {
System.out.println("Parsed a row: " + JSON.toJSONString(data));
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
System.out.println("All data parsed!");
}
}
public static void main(String[] args) {
String fileName = "demo.xlsx";
// read Excel file
FastExcel.read(fileName, DemoData.class, new DemoDataListener())
.sheet().doRead();
}Simple example to create an Excel file:
// data class
public class DemoData {
@ExcelProperty("String Title")
private String string;
@ExcelProperty("Date Title")
private Date date;
@ExcelProperty("Number Title")
private Double doubleData;
@ExcelIgnore
private String ignore;
}
// write Excel file
public static void main(String[] args) {
String fileName = "demo.xlsx";
// create sheet named "Template" and write data
FastExcel.write(fileName, DemoData.class)
.sheet("Template")
.doWrite(data());
}Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Su San Talks Tech
Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
