スポンサーサイト
上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。
新しい記事を書く事で広告が消せます。
JavaをバージョンアップしたときのEclipseの設定変更あれこれ
OSはWindows7 Pro SP1 64bit。
EclipseはINDIGO(3.7.2)。
JDKを6 update 43から7 update 17にアップデートしたときのメモ。
JDK 7はOracleからダウンロードして普通にインストール。
Eclipseを開いて
Window→Preferences→Java→Compiler→Compiler compliance levelで1.7を選択。
すると下の方に
When selecting 1.7 compliance, make sure to have a compatible JRE installed and activated (currently 1.6). Configure...
とか出るので「Configure...」のところをクリック(あるいはJava→Installed JREsをクリック)。
そこでAdd...ボタンをクリック→Standard VMを選択してNextボタンをクリック。
Directory...ボタンをクリックしてC:\Program Files\Java\jre7を選択してOKボタンをクリック→Finishボタンをクリック。
Installed JREsの一覧に追加されたjre7にチェックを入れてOKボタンをクリック。
The compiler settings have changed. A full rebuild is required for changes to take effect. Do the full build now?
とか出てくるからYesボタンをクリック。
----------- 以下プロジェクトごとに繰り返し -----------
Package Explorerからプロジェクトを右クリック→Properties→Java Compiler→Use compliance from execution environment 'JavaSE-1.6 on the 'Java Build Path'についてるチェックを外す。
すると下の方に
When selecting 1.7 compliance, make sure to have a compatible JRE installed and activated (current 1.6). Configure the 'Installed JREs' and 'Execution Environments'or change the JRE on the 'Java Build Path'.
とか出るので'Java Build Path'のところをクリック。
そこでAdd Library...ボタンをクリック→JRE System Libraryを選択してNextボタンをクリック→Workspace default JRE (jre7)を選択してFinishボタンをクリック。
JRE System Libraary [jre6]を選択してRemoveボタンをクリック→OKボタンをクリック。
The compiler settings have changed. A rebuild of the project is required for changes to take effect. Build the project now?
とか出てくるからYesボタンをクリック。
Package Explorerからプロジェクトを右クリック→Properties→Project Facets→Javaを1.7に変更してOKボタンをクリック。
----------- ここまで -----------
Window→Preferences→Server→Runtime Environments→Apache Tomcat v7.0を選択してEdit...ボタンをクリック→JRE:でjre7を選択してFinishボタンをクリック→OKボタンをクリック。
Window→Preferences→Java→Installed JREs→jre6を選択してRemoveボタンをクリック→OKボタンをクリック
上記プロジェクトごとの変更のところでProperties→Project Facets→Javaの変更をやらないとプロジェクト名の赤バツ印が消えないプロジェクトがあった。
Windows→Show View→Problems
で見ると
Java compiler level does not match the version of the installed Java project facet.
となっていて気付いた次第。
EclipseはINDIGO(3.7.2)。
JDKを6 update 43から7 update 17にアップデートしたときのメモ。
JDK 7はOracleからダウンロードして普通にインストール。
Eclipseを開いて
Window→Preferences→Java→Compiler→Compiler compliance levelで1.7を選択。
すると下の方に
When selecting 1.7 compliance, make sure to have a compatible JRE installed and activated (currently 1.6). Configure...
とか出るので「Configure...」のところをクリック(あるいはJava→Installed JREsをクリック)。
そこでAdd...ボタンをクリック→Standard VMを選択してNextボタンをクリック。
Directory...ボタンをクリックしてC:\Program Files\Java\jre7を選択してOKボタンをクリック→Finishボタンをクリック。
Installed JREsの一覧に追加されたjre7にチェックを入れてOKボタンをクリック。
The compiler settings have changed. A full rebuild is required for changes to take effect. Do the full build now?
とか出てくるからYesボタンをクリック。
----------- 以下プロジェクトごとに繰り返し -----------
Package Explorerからプロジェクトを右クリック→Properties→Java Compiler→Use compliance from execution environment 'JavaSE-1.6 on the 'Java Build Path'についてるチェックを外す。
すると下の方に
When selecting 1.7 compliance, make sure to have a compatible JRE installed and activated (current 1.6). Configure the 'Installed JREs' and 'Execution Environments'or change the JRE on the 'Java Build Path'.
とか出るので'Java Build Path'のところをクリック。
そこでAdd Library...ボタンをクリック→JRE System Libraryを選択してNextボタンをクリック→Workspace default JRE (jre7)を選択してFinishボタンをクリック。
JRE System Libraary [jre6]を選択してRemoveボタンをクリック→OKボタンをクリック。
The compiler settings have changed. A rebuild of the project is required for changes to take effect. Build the project now?
とか出てくるからYesボタンをクリック。
Package Explorerからプロジェクトを右クリック→Properties→Project Facets→Javaを1.7に変更してOKボタンをクリック。
----------- ここまで -----------
Window→Preferences→Server→Runtime Environments→Apache Tomcat v7.0を選択してEdit...ボタンをクリック→JRE:でjre7を選択してFinishボタンをクリック→OKボタンをクリック。
Window→Preferences→Java→Installed JREs→jre6を選択してRemoveボタンをクリック→OKボタンをクリック
上記プロジェクトごとの変更のところでProperties→Project Facets→Javaの変更をやらないとプロジェクト名の赤バツ印が消えないプロジェクトがあった。
Windows→Show View→Problems
で見ると
Java compiler level does not match the version of the installed Java project facet.
となっていて気付いた次第。
スポンサーサイト
tomcatインストールと設定(起動・停止スクリプトまで)
tomcatの稼働ユーザ:グループ -> tomcat:tomcat
JAVA_HOME -> /usr/local/java
CATALINA_HOME -> /usr/local/tomcat
設定ファイル -> /etc/tomcat/tomcat.conf、/etc/sysconfig/tomcat
起動・停止スクリプト -> /etc/init.d/tomcat
になるようにインストールする。OSはRHEL6系。
■tomcatユーザ・グループ作成(idは各々の環境で適切なものに)
# groupadd -g 555 tomcat
# useradd -u 555 -g tomcat -s /bain/bash -d /usr/local/tomcat -M tomcat
■JREインストール
# ./jre-6u33-linux-x64-rpm.bin
# cd /usr/local
# ln -s /usr/java/jre1.6.0_33 java
■tomcatインストール
# tar zxf apache-tomcat-7.0.29.tar.gz
# cp -R apache-tomcat-7.0.29 /usr/.
# cd /usr/local
# ln -s /usr/apache-tomcat-7.0.29 tomcat
# chown -R tomcat:tomcat tomcat/
# cd /var/log
# mkdir tomcat
# cd /etc
# mkdir tomcat
■設定(GCなどは各々の環境に合わせて)
# vi /etc/tomcat/tomcat.conf
もうひとつ
# vi /etc/sysconfig/tomcat
↓
上記tomcat.confと同内容で全てコメントアウトしておく。
■起動・停止スクリプト
■起動・停止スクリプトから呼び出すスクリプトの編集
# vi /usr/local/tomcat/bin/catalina.sh
450行目付近
482行目付近
JAVA_HOME -> /usr/local/java
CATALINA_HOME -> /usr/local/tomcat
設定ファイル -> /etc/tomcat/tomcat.conf、/etc/sysconfig/tomcat
起動・停止スクリプト -> /etc/init.d/tomcat
になるようにインストールする。OSはRHEL6系。
■tomcatユーザ・グループ作成(idは各々の環境で適切なものに)
# groupadd -g 555 tomcat
# useradd -u 555 -g tomcat -s /bain/bash -d /usr/local/tomcat -M tomcat
■JREインストール
# ./jre-6u33-linux-x64-rpm.bin
# cd /usr/local
# ln -s /usr/java/jre1.6.0_33 java
■tomcatインストール
# tar zxf apache-tomcat-7.0.29.tar.gz
# cp -R apache-tomcat-7.0.29 /usr/.
# cd /usr/local
# ln -s /usr/apache-tomcat-7.0.29 tomcat
# chown -R tomcat:tomcat tomcat/
# cd /var/log
# mkdir tomcat
# cd /etc
# mkdir tomcat
■設定(GCなどは各々の環境に合わせて)
# vi /etc/tomcat/tomcat.conf
# Where your java installation lives
JAVA_HOME="/usr/local/java"
# Where your tomcat installation lives
CATALINA_BASE="/usr/local/tomcat"
CATALINA_HOME="/usr/local/tomcat"
JASPER_HOME="/usr/local/tomcat"
CATALINA_TMPDIR="/usr/local/tomcat/temp"
# You can pass some parameters to java here if you wish to
#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3"
# Use JAVA_OPTS to set java.library.path for libtcnative.so
#JAVA_OPTS="-Djava.library.path=/usr/lib64"
# Heap
JAVA_OPTS="-server -Xmx512m -Xms512m -XX:PermSize=64m -XX:NewRatio=2 -XX:SurvivorRatio=25 -XX:+UseParallelGC -XX:ParallelGCThreads=2"
# What user should run tomcat
#TOMCAT_USER="tomcat"
# You can change your tomcat locale here
#LANG="en_US"
# Run tomcat under the Java Security Manager
#SECURITY_MANAGER="false"
# Time to wait in seconds, before killing process
SHUTDOWN_WAIT="2"
# Whether to annoy the user with "attempting to shut down" messages or not
#SHUTDOWN_VERBOSE="false"
# Set the TOMCAT_PID location
CATALINA_PID="/var/run/tomcat.pid"
# Connector port is 8080 for this tomcat instance
#CONNECTOR_PORT="8080"
# If you wish to further customize your tomcat environment,
# put your own definitions here
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)
もうひとつ
# vi /etc/sysconfig/tomcat
↓
上記tomcat.confと同内容で全てコメントアウトしておく。
■起動・停止スクリプト
# vi /etc/init.d/tomcat
#!/bin/bash
#
# tomcat This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Description:
# Short-Description: start and stop tomcat
### END INIT INFO
#
# - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot
# - heavily rewritten by Deepak Bhole and Jason Corley
#
## Source function library.
#. /etc/rc.d/init.d/functions
# Source LSB function library.
if [ -r /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
else
exit 1
fi
DISTRIB_ID=`lsb_release -i -s 2>/dev/null`
NAME="$(basename $0)"
unset ISBOOT
if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
NAME="${NAME:3}"
ISBOOT="1"
fi
# For SELinux we need to use 'runuser' not 'su'
if [ -x "/sbin/runuser" ]; then
SU="/sbin/runuser -s /bin/sh"
else
SU="/bin/su -s /bin/sh"
fi
# Get instance specific config file
if [ -r "/etc/sysconfig/${NAME}" ]; then
. /etc/sysconfig/${NAME}
fi
# Define which connector port to use
CONNECTOR_PORT="${CONNECTOR_PORT:-8080}"
# Path to the tomcat launch script
TOMCAT_SCRIPT="${CATALINA_HOME}/bin/catalina.sh"
# Tomcat program name
TOMCAT_PROG="${NAME}"
# Define the tomcat username
TOMCAT_USER="${TOMCAT_USER:-tomcat}"
# Define the tomcat log file
TOMCAT_LOG="${TOMCAT_LOG:-/var/log/${NAME}/catalina.out}"
RETVAL="0"
# Look for open ports, as the function name might imply
function findFreePorts() {
local isSet1="false"
local isSet2="false"
local isSet3="false"
local lower="8000"
randomPort1="0"
randomPort2="0"
randomPort3="0"
local -a listeners="( $(
netstat -ntl | \
awk '/^tcp/ {gsub("(.)*:", "", $4); print $4}'
) )"
while [ "$isSet1" = "false" ] || \
[ "$isSet2" = "false" ] || \
[ "$isSet3" = "false" ]; do
let port="${lower}+${RANDOM:0:4}"
if [ -z `expr " ${listeners[*]} " : ".*\( $port \).*"` ]; then
if [ "$isSet1" = "false" ]; then
export randomPort1="$port"
isSet1="true"
elif [ "$isSet2" = "false" ]; then
export randomPort2="$port"
isSet2="true"
elif [ "$isSet3" = "false" ]; then
export randomPort3="$port"
isSet3="true"
fi
fi
done
}
function makeHomeDir() {
if [ ! -d "$CATALINA_HOME" ]; then
mkdir -p /var/log/${NAME} \
/var/cache/${NAME} \
/var/tmp/${NAME}
ln -fs /var/cache/${NAME} ${CATALINA_HOME}/work
ln -fs /var/tmp/${NAME} ${CATALINA_HOME}/temp
ln -fs /var/log/${NAME} ${CATALINA_HOME}/logs
chown ${TOMCAT_USER}:root /var/log/${NAME}
fi
}
function parseOptions() {
options=""
if [ -r "/etc/sysconfig/${NAME}" ]; then
options="$options $(
awk '!/^#/ && !/^$/ { ORS=" ";
print "export ", $0, ";" }' \
/etc/sysconfig/${NAME}
)"
fi
TOMCAT_SCRIPT="$options ${TOMCAT_SCRIPT}"
}
# See how we were called.
function start() {
echo -n "Starting ${TOMCAT_PROG}: "
if [ "$RETVAL" != "0" ]; then
log_failure_msg
return
fi
if [ -f "/var/lock/subsys/${NAME}" ]; then
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
# if checkpid $kpid 2>&1; then
if [ -d "/proc/${kpid}" ]; then
log_success_msg
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
echo
fi
RETVAL="0"
return
fi
fi
fi
# fix permissions on the log and pid files
export CATALINA_PID="/var/run/${NAME}.pid"
touch $CATALINA_PID 2>&1 || RETVAL="4"
if [ "$RETVAL" -eq "0" -a "$?" -eq "0" ]; then
chown ${TOMCAT_USER}:${TOMCAT_USER} $CATALINA_PID
fi
[ "$RETVAL" -eq "0" ] && touch $TOMCAT_LOG 2>&1 || RETVAL="4"
if [ "$RETVAL" -eq "0" -a "$?" -eq "0" ]; then
chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG
fi
parseOptions
if [ "$RETVAL" -eq "0" -a "$SECURITY_MANAGER" = "true" ]; then
$SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start-security ${TOMCAT_LOG}" \
>> /var/log/${NAME}/initd.log 2>&1 || RETVAL="4"
else
[ "$RETVAL" -eq "0" ] && $SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start ${TOMCAT_LOG}" >> /var/log/${NAME}/initd.log 2>&1 || RETV
AL="4"
fi
if [ "$RETVAL" -eq "0" ]; then
log_success_msg
touch /var/lock/subsys/${NAME}
else
log_failure_msg "Error code ${RETVAL}"
fi
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
echo
fi
}
function stop() {
echo -n "Stopping ${TOMCAT_PROG}: "
if [ -f "/var/lock/subsys/${NAME}" ]; then
parseOptions
if [ "$RETVAL" -eq "0" ]; then
touch /var/lock/subsys/${NAME} 2>&1 || RETVAL="4"
[ "$RETVAL" -eq "0" ] && $SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} stop ${TOMCAT_LOG}" >> /var/log/${NAME}/initd.out 2>&1 || RET
VAL="4"
fi
if [ "$RETVAL" -eq "0" ]; then
count="0"
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \
[ "$count" -gt "$SHUTDOWN_WAIT" ]; do
if [ "$SHUTDOWN_VERBOSE" = "true" ]; then
echo "waiting for processes $kpid to exit"
fi
sleep 1
let count="${count}+1"
done
if [ "$count" -gt "$SHUTDOWN_WAIT" ]; then
if [ "$SHUTDOWN_VERBOSE" = "true" ]; then
log_warning_msg "killing processes which did not stop after ${SHUTDOWN_WAIT} seconds"
fi
kill -9 $kpid
fi
log_success_msg
fi
rm -f /var/lock/subsys/${NAME} /var/run/${NAME}.pid
else
log_failure_msg
RETVAL="4"
fi
else
log_success_msg
RETVAL="0"
fi
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
echo
fi
}
function status()
{
checkpidfile
if [ "$RETVAL" -eq "0" ]; then
log_success_msg "${NAME} (pid ${kpid}) is running..."
elif [ "$RETVAL" -eq "1" ]; then
log_failure_msg "PID file exists, but process is not running"
else
checklockfile
if [ "$RETVAL" -eq "2" ]; then
log_failure_msg "${NAME} lockfile exists but process is not running"
else
pid="$(/usr/bin/pgrep -d , -u ${TOMCAT_USER} -G ${TOMCAT_USER} java)"
if [ -z "$pid" ]; then
log_success_msg "${NAME} is stopped"
RETVAL="3"
else
log_success_msg "${NAME} (pid $pid) is running..."
RETVAL="0"
fi
fi
fi
}
function checklockfile()
{
if [ -f /var/lock/subsys/${NAME} ]; then
pid="$(/usr/bin/pgrep -d , -u ${TOMCAT_USER} -G ${TOMCAT_USER} java)"
# The lockfile exists but the process is not running
if [ -z "$pid" ]; then
RETVAL="2"
fi
fi
}
function checkpidfile()
{
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
if [ -d "/proc/${kpid}" ]; then
# The pid file exists and the process is running
RETVAL="0"
else
# The pid file exists but the process is not running
RETVAL="1"
return
fi
fi
# pid file does not exist and program is not running
RETVAL="3"
}
function usage()
{
echo "Usage: $0 {start|stop|restart|condrestart|try-restart|reload|force-reload|status|version}"
RETVAL="2"
}
# See how we were called.
RETVAL="0"
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart|try-restart)
if [ -f "/var/run/${NAME}.pid" ]; then
stop
start
fi
;;
reload)
RETVAL="3"
;;
force-reload)
if [ -f "/var/run/${NAME}.pid" ]; then
stop
start
fi
;;
status)
status
;;
version)
${TOMCAT_SCRIPT} version
;;
*)
usage
;;
esac
exit $RETVAL
■起動・停止スクリプトから呼び出すスクリプトの編集
# vi /usr/local/tomcat/bin/catalina.sh
SLEEP=5
↓変更
SLEEP=1
450行目付近
if [ $? -gt 0 ]; then
rm -f "$CATALINA_PID" >/dev/null 2>&1
if [ $? != 0 ]; then
if [ -w "$CATALINA_PID" ]; then
cat /dev/null > "$CATALINA_PID"
else
echo "Tomcat stopped but the PID file could not be removed or cleared."
fi
fi
break
fi
↓コメントアウト
#if [ $? -gt 0 ]; then
# rm -f "$CATALINA_PID" >/dev/null 2>&1
# if [ $? != 0 ]; then
# if [ -w "$CATALINA_PID" ]; then
# cat /dev/null > "$CATALINA_PID"
# else
# echo "Tomcat stopped but the PID file could not be removed or cleared."
# fi
# fi
# break
#fi
482行目付近
rm -f "$CATALINA_PID" >/dev/null 2>&1
if [ $? != 0 ]; then
echo "Tomcat was killed but the PID file could not be removed."
fi
↓コメントアウト
#rm -f "$CATALINA_PID" >/dev/null 2>&1
#if [ $? != 0 ]; then
# echo "Tomcat was killed but the PID file could not be removed."
#fi
Eclipse 3.5を余分なプラグインなしでインストール
今までの3.4環境にRadRailsを入れようと思って色々やってたら、いい感じに壊れていった。。
ということで、3.5を新たに入れ直す。ちなみに前のと一部内容がかぶる。
Eclipse 3.5.1 Classic
+
------- plugins -------
GEF
RadRails
WTP
JStyle
EclipseHTMLEditor
StrutsIDE
Property Editor
------- plugins -------
でインストールする。
■Eclipse Classicのインストール
Eclipse Classic(eclipse-SDK-VERSION-win32.zip)をダウンロードして解凍。
eclipseディレクトリをC:\Program Files\にコピー。
■GEFのインストール
Help -> Install New Software
Work withにhttp://download.eclipse.org/tools/gef/updates/releasesを入力してAddをクリック
Nameを「GEF Update Site」とかにしてOKをクリック
GEF SDK 3.5.1をチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
インストール後
Software Updates
It is strongly recommended you restart Eclipse SDK for the changes to
take effect. For some add-ons, it may be possible to apply the changes
you have made without restarting. Would you like to restart now?
と、Eclipse再起動を促されるのでYesをクリックして再起動。
■RadRailsのインストール
FireFoxを最初にインストールしておかないと、RadRailsインストール後、FireFox Extensionなんたらかんたらでエラーがでるから
インストールしておいた方がいい。
で、RadRailsのインストール。
http://aptana.com/radrails/download/
でInstallation Typeの選択をEclipse PluginにしてDownload Nowボタンをクリック
そうするとUpdate SiteのURLが表示されるからコピー。
Work withにコピーしたURLを貼り付けてAddをクリック
Nameを「RadRails Update Site」とかにしてOKをクリック
RailsをチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
途中、
Security Warning
Warning: You are installing software that contains unsigned content. The
authenticity or validity of this software cannot be established. Do you
want to continue with the installation?
とか警告ダイアログが出るけど、OKをクリックして継続。
インストール後
Software Updates
It is strongly recommended you restart Eclipse SDK for the changes to
take effect. For some add-ons, it may be possible to apply the changes
you have made without restarting. Would you like to restart now?
と、Eclipse再起動を促されるのでYesをクリックして再起動。
ひとつ気になるのはAptana Studio Professionalがセットでインストールされてしまうこと。
選択して抜くことができない。RadRailsのWebでは有料とかそういうことに触れてない。
有効期限がexpireしたとき何かあるんだろうか。その有効期限にも特に触れてないようだけど…。
■WTPのインストール
Help -> Install New Software
Work withにhttp://download.eclipse.org/webtools/updates/を入力してAddをクリック
Nameを「Web Tools Platform (WTP)」とかにしてOKをクリック
Web Tools Platform (WTP) 3.1.1とProject Provided ComponentsをチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
途中、
Security Warning
Warning: You are installing software that contains unsigned content The
authenticity or validity of this software cannot be established. Do you
want to continue with the installation?
とか警告ダイアログが出るけど、OKをクリックして継続。
インストール後
Software Updates
It is strongly recommended you restart Eclipse SDK for the changes to
take effect. For some add-ons, it may be possible to apply the changes
you have made without restarting. Would you like to restart now?
と、Eclipse再起動を促されるのでYesをクリックして再起動。
■JStyleのインストール
JStyle_VERSION.zipをダウンロードして解凍。
pluginsの中のjarファイルををC:\Program Files\eclipse\dropins\にコピー。
■EclipseHTMLEditorのインストール
tk.eclipse.plugin.htmleditor_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\dropins\にコピー。
■StrutsIDEのインストール
tk.eclipse.plugin.struts_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\dropins\にコピー。
Eclipseを再起動。
■Property Editorのインストール
Help -> Install New Software
Work withにhttp://propedit.sourceforge.jp/eclipse/updates/を入力してAddをクリック
Nameを「PropertiesEditor Update Site」とかにしてOKをクリック
PropertiesEditorをチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
■その他設定変更
Window → Preferences → Server → Runtime Environments → Add
→ Apache Tomcat v5.5を選択 → Next → Tomcat installation directoryにTomcatのインストールディレクトリ
(C:\Program Files\Apache Software Foundation\Tomcat 5.5)を指定
→ JREにjre6を選択 → Finish
起動時にMyRadRailsが表示されるのをやめたい場合は、
Window → Preferences → General → Startup and Shutdown → Aptana Introのチェックを外す
→ OK
■既存プロジェクトインポート
File → import → General → Existing Project into Workspace
→ Next → Select root directoryでプロジェクトのルートディレクトリを選択
→ 前のEclipseとworkspaceが違う場合、Copy projects into workspaceにチェック → Finish
…is raw typeとか出てくる場合
Window → Preferences → Java → Compiler → Errors/Warnings → Generic types
→ Usage of a raw typeをignore → OK
The serializable class hoge does not declare a static final serialVersionUID … とか出てくる場合
Window → Preferences → Java → Compiler → Errors/Warnings → Potential programming problems
→ Serializable class without serialVersionUIDをignore → OK
ということで、3.5を新たに入れ直す。ちなみに前のと一部内容がかぶる。
Eclipse 3.5.1 Classic
+
------- plugins -------
GEF
RadRails
WTP
JStyle
EclipseHTMLEditor
StrutsIDE
Property Editor
------- plugins -------
でインストールする。
■Eclipse Classicのインストール
Eclipse Classic(eclipse-SDK-VERSION-win32.zip)をダウンロードして解凍。
eclipseディレクトリをC:\Program Files\にコピー。
■GEFのインストール
Help -> Install New Software
Work withにhttp://download.eclipse.org/tools/gef/updates/releasesを入力してAddをクリック
Nameを「GEF Update Site」とかにしてOKをクリック
GEF SDK 3.5.1をチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
インストール後
Software Updates
It is strongly recommended you restart Eclipse SDK for the changes to
take effect. For some add-ons, it may be possible to apply the changes
you have made without restarting. Would you like to restart now?
と、Eclipse再起動を促されるのでYesをクリックして再起動。
■RadRailsのインストール
FireFoxを最初にインストールしておかないと、RadRailsインストール後、FireFox Extensionなんたらかんたらでエラーがでるから
インストールしておいた方がいい。
で、RadRailsのインストール。
http://aptana.com/radrails/download/
でInstallation Typeの選択をEclipse PluginにしてDownload Nowボタンをクリック
そうするとUpdate SiteのURLが表示されるからコピー。
Work withにコピーしたURLを貼り付けてAddをクリック
Nameを「RadRails Update Site」とかにしてOKをクリック
RailsをチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
途中、
Security Warning
Warning: You are installing software that contains unsigned content. The
authenticity or validity of this software cannot be established. Do you
want to continue with the installation?
とか警告ダイアログが出るけど、OKをクリックして継続。
インストール後
Software Updates
It is strongly recommended you restart Eclipse SDK for the changes to
take effect. For some add-ons, it may be possible to apply the changes
you have made without restarting. Would you like to restart now?
と、Eclipse再起動を促されるのでYesをクリックして再起動。
ひとつ気になるのはAptana Studio Professionalがセットでインストールされてしまうこと。
選択して抜くことができない。RadRailsのWebでは有料とかそういうことに触れてない。
有効期限がexpireしたとき何かあるんだろうか。その有効期限にも特に触れてないようだけど…。
■WTPのインストール
Help -> Install New Software
Work withにhttp://download.eclipse.org/webtools/updates/を入力してAddをクリック
Nameを「Web Tools Platform (WTP)」とかにしてOKをクリック
Web Tools Platform (WTP) 3.1.1とProject Provided ComponentsをチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
途中、
Security Warning
Warning: You are installing software that contains unsigned content The
authenticity or validity of this software cannot be established. Do you
want to continue with the installation?
とか警告ダイアログが出るけど、OKをクリックして継続。
インストール後
Software Updates
It is strongly recommended you restart Eclipse SDK for the changes to
take effect. For some add-ons, it may be possible to apply the changes
you have made without restarting. Would you like to restart now?
と、Eclipse再起動を促されるのでYesをクリックして再起動。
■JStyleのインストール
JStyle_VERSION.zipをダウンロードして解凍。
pluginsの中のjarファイルををC:\Program Files\eclipse\dropins\にコピー。
■EclipseHTMLEditorのインストール
tk.eclipse.plugin.htmleditor_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\dropins\にコピー。
■StrutsIDEのインストール
tk.eclipse.plugin.struts_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\dropins\にコピー。
Eclipseを再起動。
■Property Editorのインストール
Help -> Install New Software
Work withにhttp://propedit.sourceforge.jp/eclipse/updates/を入力してAddをクリック
Nameを「PropertiesEditor Update Site」とかにしてOKをクリック
PropertiesEditorをチェックしてNextをクリック
もう1回Nextをクリック
I accept the terms of the license agreementsをチェックしてFinishをクリック
■その他設定変更
Window → Preferences → Server → Runtime Environments → Add
→ Apache Tomcat v5.5を選択 → Next → Tomcat installation directoryにTomcatのインストールディレクトリ
(C:\Program Files\Apache Software Foundation\Tomcat 5.5)を指定
→ JREにjre6を選択 → Finish
起動時にMyRadRailsが表示されるのをやめたい場合は、
Window → Preferences → General → Startup and Shutdown → Aptana Introのチェックを外す
→ OK
■既存プロジェクトインポート
File → import → General → Existing Project into Workspace
→ Next → Select root directoryでプロジェクトのルートディレクトリを選択
→ 前のEclipseとworkspaceが違う場合、Copy projects into workspaceにチェック → Finish
…is raw typeとか出てくる場合
Window → Preferences → Java → Compiler → Errors/Warnings → Generic types
→ Usage of a raw typeをignore → OK
The serializable class hoge does not declare a static final serialVersionUID … とか出てくる場合
Window → Preferences → Java → Compiler → Errors/Warnings → Potential programming problems
→ Serializable class without serialVersionUIDをignore → OK
JREを1.5から1.6にバージョンアップしたらヒープのエラーでTomcatが起動しない
Tomcatが動いてるサーバのJREを1.5.0_15から1.6.0_11にバージョンアップしたら
↓みたいなエラーが出てTomcatが起動しなくなった。
Error occurred during initialization of VM
Could not reserve enough space for object heap
OSは64bitでJREも64bit。メモリはたっぷり。
JAVA_OPTSは↓
-Xmx1024m -Xms1024m -XX:NewSize=256m -XX:PermSize=128m -XX:NewRatio=2 -XX:SurvivorRatio=25
どうも-XX:NewSizeの記述を無くせばエラーが出ないっぽい。
こんな感じ↓
-Xmx1024m -Xms1024m -XX:PermSize=128m -XX:NewRatio=2 -XX:SurvivorRatio=25
↓みたいなエラーが出てTomcatが起動しなくなった。
Error occurred during initialization of VM
Could not reserve enough space for object heap
OSは64bitでJREも64bit。メモリはたっぷり。
JAVA_OPTSは↓
-Xmx1024m -Xms1024m -XX:NewSize=256m -XX:PermSize=128m -XX:NewRatio=2 -XX:SurvivorRatio=25
どうも-XX:NewSizeの記述を無くせばエラーが出ないっぽい。
こんな感じ↓
-Xmx1024m -Xms1024m -XX:PermSize=128m -XX:NewRatio=2 -XX:SurvivorRatio=25
Eclipseを余分なプラグインなしでインストール
Eclipse 3.4へのバージョンアップを機に余分なプラグインを入れないようにしたかった。
用途はとりあえずWebアプリ用。
ということで、
Eclipse 3.4 Classic
+
------- plugins -------
Pleiades
JStyle
WTP
SpringIDE
EclipseHTMLEditor
StrutsIDE
Property Editor
------- plugins -------
でインストールする手順。
※Eclipseの前に、JDKとJREを1.5.0_14から1.6.0_11にバージョンアップしといた。
■Eclipse Classicのインストール
Eclipse Classic(eclipse-SDK-VERSION-win32.zip)をダウンロードして解凍。
eclipseディレクトリをC:\Program Files\にコピー。
■pleiadesのインストール
pleiades.zipをダウンロードして解凍。
features、plugins、readmeをC:\Program Files\eclipse\にコピー。
【eclipse.ini】
-showsplash
org.eclipse.platform
を削除。
最終行に
-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
を追加。
ついでにXmsを128mに変更して結局こんな感じ↓
-startup
plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731
--launcher.XXMaxPermSize
256m
-vmargs
-Xms128m
-Xmx256m
-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
■JStyleのインストール
JStyle_VERSION.zipをダウンロードして解凍。
pluginsをC:\Program Files\eclipse\にコピー。
■初回起動
コマンドプロンプトから
C:\Program Files> eclipse.exe -clean
■WTPのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ Ganymede更新サイト
→ Web開発ツール、Java EE開発者ツールにチェック → インストール → 次へ
→ 使用条件の条項に同意しますにチェック → 完了
■SpringIDEのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ サイトの追加 → http://springide.org/updatesite/を入力
→ OK → Sprint IDE 更新サイト → コアをチェック → インストール → 次へ
→ 使用条件の条項に同意しますにチェック → 完了
■GEFのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ Ganymede更新サイト
→ グラフィカル編集フレームワーク GEFをチェック → インストール → 完了
■EclipseHTMLEditorのインストール
tk.eclipse.plugin.htmleditor_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\plugins\にコピー。
■StrutsIDEのインストール
tk.eclipse.plugin.struts_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\plugins\にコピー。
■Property Editorのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ サイトの追加 → http://propedit.sourceforge.jp/eclipse/updates/を入力
→ OK → http://propedit.sourceforge.jp/eclipse/updates/をチェック → インストール → 次へ
→ 使用条件の条項に同意しますにチェック → 完了
■その他設定変更
ウィンドウ → 設定 → サーバー → ランタイム環境 → Tomcat 5.5を選択
→ 編集 → jre6を選択 → 完了
プロジェクト右クリック
→ プロパティ → Javaコンパイラー → Javaのビルド・パス
→ 今までのJREシステムライブリーを除去 → ライブラリーの追加 → JREシステム・ライブラリー
→ 次へ → ワークスペースのデフォルトJRE(jre6)を選択 → 完了
Javaコンパイラー・レベルが、インストールされているJavaプロジェクト・ファセットのバージョンと一致しません。
とかエラーが出たら該当プロジェクトを右クリック
→ プロパティ → プロジェクト・ファセット → Javaを6.0に変更 → OK
■バグ対応
JSPでスクリプトレットを使っている辺りで、↓みたいなエラーが出る。
・トークン "}" に構文エラーがあります。このトークンを削除してください 行 0
・トークン "catch" に構文エラーがあります。正しくは Identifier です 行 0
・構文エラーがあります。"Finally" を挿入して TryStatement を完了してください 行 0
WTP3.0.2のバグらしい。ということでアップデート。
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ サイトの管理 → http://download.eclipse.org/webtools/updates/をチェック → OK
eclipseを再起動して
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ Enabling Features 3.0.3にチェック
→ パッチ・フィーチャー → WTP patches for org.eclipse.jst.enterprise_ui.featureにチェック
→ Web Tools Platform (WTP) 3.0.3 → Java EE開発者ツール、Web開発者ツールにチェック
→ インストール → 完了
eclipseを閉じてコマンドプロンプトから
C:\Program Files> eclipse.exe -clean
あと
・タグ (jsp:directive.page) は空要素タグでなければなりません。
みたいな警告が出ることもあるけど、これはWTP3.0.4に期待ということらしい。
邪魔くさければウィンドウ → 設定 → Web → HTMLファイル → 検証 → 無効な空要素タグを「無視」 → OK
用途はとりあえずWebアプリ用。
ということで、
Eclipse 3.4 Classic
+
------- plugins -------
Pleiades
JStyle
WTP
SpringIDE
EclipseHTMLEditor
StrutsIDE
Property Editor
------- plugins -------
でインストールする手順。
※Eclipseの前に、JDKとJREを1.5.0_14から1.6.0_11にバージョンアップしといた。
■Eclipse Classicのインストール
Eclipse Classic(eclipse-SDK-VERSION-win32.zip)をダウンロードして解凍。
eclipseディレクトリをC:\Program Files\にコピー。
■pleiadesのインストール
pleiades.zipをダウンロードして解凍。
features、plugins、readmeをC:\Program Files\eclipse\にコピー。
【eclipse.ini】
-showsplash
org.eclipse.platform
を削除。
最終行に
-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
を追加。
ついでにXmsを128mに変更して結局こんな感じ↓
-startup
plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731
--launcher.XXMaxPermSize
256m
-vmargs
-Xms128m
-Xmx256m
-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
■JStyleのインストール
JStyle_VERSION.zipをダウンロードして解凍。
pluginsをC:\Program Files\eclipse\にコピー。
■初回起動
コマンドプロンプトから
C:\Program Files> eclipse.exe -clean
■WTPのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ Ganymede更新サイト
→ Web開発ツール、Java EE開発者ツールにチェック → インストール → 次へ
→ 使用条件の条項に同意しますにチェック → 完了
■SpringIDEのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ サイトの追加 → http://springide.org/updatesite/を入力
→ OK → Sprint IDE 更新サイト → コアをチェック → インストール → 次へ
→ 使用条件の条項に同意しますにチェック → 完了
■GEFのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ Ganymede更新サイト
→ グラフィカル編集フレームワーク GEFをチェック → インストール → 完了
■EclipseHTMLEditorのインストール
tk.eclipse.plugin.htmleditor_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\plugins\にコピー。
■StrutsIDEのインストール
tk.eclipse.plugin.struts_VERSION.jar
をダウンロードして、C:\Program Files\eclipse\plugins\にコピー。
■Property Editorのインストール
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ サイトの追加 → http://propedit.sourceforge.jp/eclipse/updates/を入力
→ OK → http://propedit.sourceforge.jp/eclipse/updates/をチェック → インストール → 次へ
→ 使用条件の条項に同意しますにチェック → 完了
■その他設定変更
ウィンドウ → 設定 → サーバー → ランタイム環境 → Tomcat 5.5を選択
→ 編集 → jre6を選択 → 完了
プロジェクト右クリック
→ プロパティ → Javaコンパイラー → Javaのビルド・パス
→ 今までのJREシステムライブリーを除去 → ライブラリーの追加 → JREシステム・ライブラリー
→ 次へ → ワークスペースのデフォルトJRE(jre6)を選択 → 完了
Javaコンパイラー・レベルが、インストールされているJavaプロジェクト・ファセットのバージョンと一致しません。
とかエラーが出たら該当プロジェクトを右クリック
→ プロパティ → プロジェクト・ファセット → Javaを6.0に変更 → OK
■バグ対応
JSPでスクリプトレットを使っている辺りで、↓みたいなエラーが出る。
・トークン "}" に構文エラーがあります。このトークンを削除してください 行 0
・トークン "catch" に構文エラーがあります。正しくは Identifier です 行 0
・構文エラーがあります。"Finally" を挿入して TryStatement を完了してください 行 0
WTP3.0.2のバグらしい。ということでアップデート。
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ サイトの管理 → http://download.eclipse.org/webtools/updates/をチェック → OK
eclipseを再起動して
ヘルプ → ソフトウェア更新 → 使用可能なソフトウェア
→ Enabling Features 3.0.3にチェック
→ パッチ・フィーチャー → WTP patches for org.eclipse.jst.enterprise_ui.featureにチェック
→ Web Tools Platform (WTP) 3.0.3 → Java EE開発者ツール、Web開発者ツールにチェック
→ インストール → 完了
eclipseを閉じてコマンドプロンプトから
C:\Program Files> eclipse.exe -clean
あと
・タグ (jsp:directive.page) は空要素タグでなければなりません。
みたいな警告が出ることもあるけど、これはWTP3.0.4に期待ということらしい。
邪魔くさければウィンドウ → 設定 → Web → HTMLファイル → 検証 → 無効な空要素タグを「無視」 → OK