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


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

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

       安裝過程結(jié)束。


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

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

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

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

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