Java開発環境構築手順
この記事は古いです。d:id:u6k:20110102を参照してください。
http://d.hatena.ne.jp/u6k/20090616
個人的なJava開発環境の構築手順を記述します。普段はこれをzipアーカイブして持ち歩き、Java開発環境を構築するときはそれを解凍することで楽に構築できるようにしています(PostgreSQLのみインストールが必要)。
Apache Ant
ダウンロード、展開、
「Apache Ant」をダウンロード、「C:\eclipse」フォルダに展開します。「C:\eclipse\apache-ant-x.x.x」フォルダが作成されます。
Apache Maven
ダウンロード、展開
「Apache Maven」をダウンロード、「C:\eclipse」フォルダに展開します。「C:\eclipse\apache-maven-x.x.x」フォルダが作成されます。
PostgreSQL
ダウンロード、インストール
「PostgreSQL」をダウンロード、インストールします。
Apache Tomcat
ダウンロード、展開
「Apache Tomcat」をダウンロード、「C:\eclipse」フォルダに展開します。「C:\eclipse\apache-tomcat-x.x.x」フォルダが作成されます。
Jad
ダウンロード、展開
「Jad」をダウンロードします。ただし、2009/4/18時点ではJadの公式サイトが閉鎖しており、「Internet Archive」からダウンロードできます(参考: JADの行方 - Java Solution - @IT)。
ダウンロードしたファイルを「C:\eclipse」に展開します。「C:\eclipse\jadntxxx」が作成されます。
Eclipse
ダウンロード、展開
「Eclipse IDE for Java EE Developers」をダウンロード、「C:\eclipse」フォルダに展開します。「C:\eclipse\eclipse」フォルダが作成されます。
設定
以下のように設定します。
[Preferences] [General] Always run in background=True Show heap status=True [Appearance] [Colors and Fonts] Basic/ Text Font=MS ゴシック, 標準, 9 [Editors] [Text Editors] Undo history size=9999 Insert spaces for tabs=True Show line numbers=True [Spelling] Enable spell checking=False [Network Connections] System proxy configuration (if available)=True [Workspace] Text file encoding=Other UTF-8 New text file line delimiter=Other Windows [Java] [Build Path] Folders=True Source folder name=src/main/java Output folder name=target/classes [Code Style] [Code Templates] Comments/ Types=/** * <p> * </p> * @version $$Id$$ */ Fields=/** * <p> * ___${field}___。 * </p> */ Getters=/** * <p> * ___${bare_field_name}___を返します。 * </p> * @return ___${bare_field_name}___。 */ Setters=/** * <p> * ___${bare_field_name}___を設定します。 * </p> * @param ${param} ___${bare_field_name}___。 */ Code/ Getter body=return this.${field}; [Formatter] 「Eclipse [built-in]」を元に新しいプロファイルを作成。 Indentation/ Tab policy=Spaces only Statements within 'switch' body=True Blank Lines/ Before package declaration=1 Before first declaration=1 Before field declarations=1 New Lines/ at end of file=True Line Wrapping/ Maximum line width=9999 Comments/ Javadoc comment settings/ Remove blank lines=True Block comment settings/ Remove blank lines=True Maximum line width for comments=9999 [Compiler] Compiler compliance level=1.6 [Editor] [Content Assist] [Auto-Activation] Enable auto activation=False [Save Actions] Perform the selected actions on save=True Format source code=True [JadClipse] Path to decompiler=C:\eclipse\jadnt158\jad.exe [JavaScript] [Code Style] [Formatter] 「Eclipse [build-in]」を元に新しいプロファイルを作成。 Indentation/ General settings/ Tab policy=Spaces only Indent/ Statements within 'switch' body=True New Lines/ Insert new line/ at end of file=True Line Wrapping/ Line width and indentation levels/ Maximum line width=9999 Comments/ General settings/ Enable header comment formatting=True Jsdoc comment settings/ Remove blank lines=True Line width/ Maximum line width for comments=9999 [Editor] [Save Actions] Perform the selected actions on save=True Format source code=True [Team] [CVS] [Label Decorations] Text Decorations/ Outgoing Change flag=■ Added flag=◆ [SVN] [ラベル装飾] テキスト/ 発信のラベル装飾=■ 追加のラベル装飾=◆ 外部のラベル装飾=● [Validation] Disable All [Web] [CSS Files] Encoding=ISO 10646/Unicode(UTF-8) [Editor] Line width=9999 Indent using spaces=Selected Indentation size=4 [HTML Files] Encoding=ISO 10646/Unicode(UTF-8) [Editor] Line width=999 Indent using spaces=Selected Indentation size=4 [JSP Files] Encoding=ISO 10646/Unicode(UTF-8) [XML] [XML Files] [Editor] Line width=999 Preserve whitespace in tags with PCDATA content=True Indent using spaces=True Indentation size=4
アプリケーション・サーバ設定
「Servers」ビューを右クリックして「New」→「Server」をクリック、J2EE Runtime Libraryを使用するように設定します。
Java SE Development Kit
ダウンロード、展開
「Java SE Development Kit」をダウンロード、通常の場所にインストールします。その後、「C:\eclipse\eclipse\jre」フォルダにインストールしたファイルをコピーします。