Believe it or not — all real-world applications have to interact with Microsoft Office in some form or another.
Many application needs to provide the functionality to export data in Excel, and if you have to do the same from your Java application, you need the Apache POI API.
This is a very rich library that allows you to both read and write XLS files from a Java program. You can see that link for a working example of reading an Excel file in a core Java application.
If you need a course or tutorial then you can also see this Create Advanced Excel files using Java, an Apache POI course on Udemy