一、安裝配置
    1)
下載
        
從官網https://glassfish.dev.java.net/public/downloadsindex.html下載GlassFish,目前最新的 final releaseGlassFish V2.1   


    2)
安裝
       
在安裝前確保jdk已安裝,且已設置JAVA_HOME屬性。

        1. copy 下載的jar文件到要安裝的目錄,如c:\Server
        2.
執行java -Xmx256m -jar filename.jar,中間會彈出關于使用許可的確認窗口。
        3.
完成后,在c:\Server目錄下會生成glassfish目錄。
        3.
進入c:\Server\glassfish, 執行antant -f setup.xml

       安裝過程結束。


    3)
配置
       
c:\Server\glassfish\bin加入到path環境變量中,以后就可以在命令行中直接使用asadmin,而不用進入到c:\Server\glassfish\bin目錄了。

    4)
運行
       
方法1:進入到glassfish\bin\目錄下,雙擊asadmin.bat,在命令行中輸入start-domain domain1
       
方法2:通過cmd 進入命令行,進入glassfish\bin目錄,執行asadmin start-domain domain1,如果已按上步將glassfish\bin加入到了path環境變量,則無需進入glassfish\bin目錄。

       執行完以上步驟后,即可通過瀏覽器訪問http://localhost:8080/確保GlassFish已正常運行,或者通過http://localhost:4848/訪問glassfish的管理控制臺。

      若要停止GlassFish,可通過命令:asadmin stop-domain domain1

二、EclipseGlassFish插件
    Eclipse
glassfish插件的安裝可參考官方文檔:https://glassfishplugins.dev.java.net/eclipse34/index.html