Use this procedure if you have downloaded the JAR-based installer from https://glassfish.dev.java.net.
Make sure that you have stopped all domains and other related processes, command prompts using the installation directory or its subdirectories, and any applications using Java Platform, Standard Edition (Java SE) files bundled with the product.
To uninstall GlassFish, perform the following steps:
Change to the directory containing the glassfish directory.
On Solaris/UNIX, run the following command: rm —r glassfish. On Windows, in the Explorer window, choose the glassfish directory and delete all its contents.