Export grid to excel - Java

Could you please explain how to include the package in our existing application to generate excel. We can’t use online services?