先日リリースされたGlassFish4をインストールしてEclipse(4.2/Juno)と連携する。
GlassFish4インストール
まずは、GlassFish4をダウンロード。
https://glassfish.java.net/download.html
![1](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/1-300x115.png)
ダウンロードしたZipを任意フォルダに展開。
展開されたフォルダ配下にある./glassfish4/bin/asadmin.batをダブルクリック実行。
![起動コマンド](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/2-300x229.png)
start-domainで起動実行
![起動実行引数](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/3-300x232.png)
http://localhost:4848/
にアクセスしDomain->Administrator Passwordからパスワードを設定。
![パスワード変更](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/4-300x147.png)
取り急ぎGlassFishのインストールはここまで。
連携用Pluginインストール
updateサイト(http://download.oracle.com/otn_software/oepe/juno)から
GlassFishツールをインストール。
![Update Manager](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/5-300x94.png)
![更新サイトアドレス](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/6-300x84.png)
![選択プラグイン](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/7-300x180.png)
インストール後eclipseの再起動を求められるので再起動を実行する。
Eclipse上でのサーバ・プロジェクト設定
(サーバ設定)
ファイル->新規->その他->サーバー->サーバーを選択。
![8](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/8-300x155.png)
サーバの種類選択画面が出るのでGlassfish4.0を選択
![9](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/9-300x188.png)
設定を聞かれるのでJREとGlassFishのインストールディレクトリを指定
![10](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/10-300x92.png)
管理者のIDとパスワードを指定
![11](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/11-300x188.png)
(プロジェクト設定)
ファイル->新規->動的WebProjectを選択。
名前を任意入力し次へ
![12](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/12-300x238.png)
そのまま次へ
![13](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/13-300x238.png)
web.xmlデプロイメント記述子の生成にチェックをいれて完了
![14](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/14-300x238.png)
疎通確認用に作成したプロジェクトのWebContent配下にindex.htmlを作成。
![16](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/16-300x232.png)
サーバタグから、GlassFishに作成したプロジェクトを追加。
![17](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/17-300x182.png)
サーバタグのGlassFishに関するステータスが「始動済み、同期済み」となっていることを確認し
プロジェクトのトップページ(http://localhost:8080/プロジェクト名/)にアクセス。
作成したhtmlが表示されていれば疎通はOK
![18](https://www.rocher.kyoto.jp/araburu/wp-content/uploads/2013/06/18-300x67.png)
使い出しなので誤りあるかもしれませんが、気づいたら順次修正します
07/09追加
Debugができなかったらリンク先の手順も追加