FastExcel: The New Java Library Replacing EasyExcel for High‑Performance Excel Processing
FastExcel, a Java‑based open‑source library announced after EasyExcel's discontinuation, offers fast, memory‑efficient Excel read/write, full compatibility with EasyExcel, simple APIs, MIT licensing for commercial use, easy Maven/Gradle integration, and clear code examples that have already attracted over 2,000 GitHub stars.
After the well‑known EasyExcel project announced it would stop updates, its original author launched a new open‑source project called FastExcel as a direct replacement.
FastExcel is a Java‑based tool designed for fast, concise handling of large Excel files while preventing memory overflow. It maintains full compatibility with EasyExcel, offering ongoing maintenance, performance optimizations, and bug fixes.
The library is released under the permissive MIT license, allowing free use in any commercial scenario.
Key features include excellent read/write performance, a simple and intuitive API, streaming support to reduce memory consumption, and seamless migration from EasyExcel—just replace the package name and dependency.
Installation
For Maven projects, add the following dependency:
<code><dependency>
<groupId>cn.idev.excel</groupId>
<artifactId>fastexcel</artifactId>
<version>1.0.0</version>
</dependency>
</code>For Gradle projects, include:
<code>dependencies {
implementation 'cn.idev.excel:fastexcel:1.0.0'
}
</code>Reading Excel files
Define a data class and a listener, then call
FastExcel.read:
<code>// Implement ReadListener interface
public class DemoDataListener implements ReadListener<DemoData> {
@Override
public void invoke(DemoData data, AnalysisContext context) {
System.out.println("Parsed a record: " + 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();
}
</code>Writing Excel files
Create a data class, populate a list, and invoke
FastExcel.write:
<code>// Example 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;
}
public static void main(String[] args) {
String fileName = "demo.xlsx";
// Create a sheet named "Template" and write data
FastExcel.write(fileName, DemoData.class)
.sheet("Template")
.doWrite(data());
}
</code>The usage is straightforward, making FastExcel easy to adopt for developers.
Since its recent release, FastExcel has quickly gained popularity, surpassing 2,000 stars on GitHub and receiving hundreds of issues and feedback from the community.
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
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.