Install Glassfish Web Server on Windows
This document is based on:
Glassfish Server is a webserver, allowing you to deploy web applications written on java. Like some other Webserver:
You may be so familiar with Tomcat, a webserver serves for the purpose of studying and development applications. Glassfish developed by Sun is stronger than Tomcat. After Java part was sold to Oracle, Glassfish becomes the product of Oracle. Currently, Glassfish server has two version: a free version with open source code, and a commercial version.
In this document I will guide you to install and configure Glassfish free version.
After downloading, you have one file:
Unzip Glassfish to specific folder on the hard drive:
Declare Java Home:
Glassfish5 requires you to use Java8 or newer. You need to declare the location of the Java:
- set path=<Java_Location>/bin
Open CMD and cd to:
- cd C:\glassfish5\bin
To start domain1 on Glassfish server:
- asadmin start-domain domain1
To stop domain1:
- asadmin stop-domain domain1
domain1 has been successful start.
Try deploying a web application:
You can download a demo web application at:
By default after being deployed, the application is run on port 8080. You can change to other port, or change to port 80. Configuration is discussed in detail below.
Open CMD as Administrator.
CD to bin folder of Glassfish:
asadmin create-service --name domain1