Java EE 8 Development with Eclipse
上QQ阅读APP看书,第一时间看更新

Installing the GlassFish server

Download GlassFish from https://glassfish.java.net/download.html. GlassFish comes in two flavors: Web Profile and Full Platform. Web Profile is like Tomcat, which does not include EJB support. So download the Full Platform.

Unzip the downloaded file in a folder. The default port of the GlassFish server is 8080. If you want to change that, open glassfish/domains/domain1/config/domain.xml in a text editor (you could open it in Eclipse too, using the File | Open File menu option) and look for 8080. You should see it in one of the <network-listener>. Change the port if you want to (which may be the case if some other application is already using that port).

To start the server, run the startserv script (.bat or .sh depending on the OS you use). Once the server has started, open a web browser and browse to http://localhost:8080. You should see a page like the following:

Figure 1.8: The default Glassfish web application

This page is located at glassfish/domains/domain1/docroot/index.html. Click on the go to the Administration Console link in the page to open the GlassFish administrator (see the following screenshot):

Figure 1.9: The Glassfish administrator


For details on administrating the GlassFish server, refer to 
https://javaee.github.io/glassfish/doc/5.0/administration-guide.pdf.

To stop the GlassFish Server, run the stopserv script in the glassfish/bin folder.