※this text from livedoor blog 2009/10/27
JDKのインストール
http://java.sun.com/javase/downloads/index.jsp
からJDK 6 Update XXをダウンロードする
$ wget "http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u16-linux-i586-rpm.bin?BundledLineItemUUID=siFIBe.l4msAAAEkPU9IJHuU&OrderID=DC9IBe.l7Q4AAAEkJk9IJHuU&ProductID=Dx1IBe.prBgAAAEirRcTvuC_&FileName=/jdk-6u16-linux-i586-rpm.bin"
ファイル名を整形する
$ mv jdk-6u16-linux-i586-rpm.bin?AuthParam=1256624149_877704959b4bf9edb012230de650f310&TicketId=B%2Fw4nBiATFhDQBRGOV5ZnAHk&GroupName=CDS&FilePath=%2FESD6%2FJSCDL%2Fjdk%2F6u16-b01%2Fjdk-6u16-linux-i586-rpm.bin&File=jdk-6u16-linux-i586-rpm.bin jdk-6u16-linux-i586-rpm.bin
$ chmod 775 jdk-6u16-linux-i586-rpm.bin
$ sudo ./jdk-6u16-linux-i586-rpm.bin
~~~~~~~~~~~~~~~
Please enter "yes" or "no".
Do you agree to the above license terms? [yes or no]
yes
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
replace jdk-6u16-linux-i586.rpm? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: jdk-6u16-linux-i586.rpm
replace sun-javadb-common-10.4.2-1.1.i386.rpm? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: sun-javadb-common-10.4.2-1.1.i386.rpm
replace sun-javadb-core-10.4.2-1.1.i386.rpm? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: sun-javadb-core-10.4.2-1.1.i386.rpm
replace sun-javadb-client-10.4.2-1.1.i386.rpm? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: sun-javadb-client-10.4.2-1.1.i386.rpm
replace sun-javadb-demo-10.4.2-1.1.i386.rpm? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: sun-javadb-demo-10.4.2-1.1.i386.rpm
replace sun-javadb-docs-10.4.2-1.1.i386.rpm? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: sun-javadb-docs-10.4.2-1.1.i386.rpm
replace sun-javadb-javadoc-10.4.2-1.1.i386.rpm? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: sun-javadb-javadoc-10.4.2-1.1.i386.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...
Installing JavaDB
Preparing... ########################################### [100%]
1:sun-javadb-common ########################################### [ 17%]
2:sun-javadb-core ########################################### [ 33%]
3:sun-javadb-client ########################################### [ 50%]
4:sun-javadb-demo ########################################### [ 67%]
5:sun-javadb-docs ########################################### [ 83%]
6:sun-javadb-javadoc ########################################### [100%]
Java(TM) SE Development Kit 6 successfully installed.
Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Sun products, services and training
* Access to early releases and documentation
Product and system data will be collected. If your configuration
supports a browser, the Sun Product Registration form for
the JDK will be presented. If you do not register, none of
this information will be saved. You may also register your
JDK later by opening the register.html file (located in
the JDK installation directory) in a browser.
For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html
Press Enter to continue.....
Done.
profile設定
$ sudo emacs /etc/profile.d/java.sh
export JAVA_HOME="/usr/java/jdk1.6.0_16"
export JAVA_PATH="$JAVA_HOME"
export PATH="$JAVA_HOME/bin:$PATH"
$ sudo su root
# source /etc/profile
# echo $JAVA_HOME
/usr/java/jdk1.6.0_16
# echo $JAVA_PATH
/usr/java/jdk1.6.0_16
# echo $PATH
/usr/java/jdk1.6.0_16/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/java/jdk1.6.0_16/bin:/usr/bin:/bin
Amazon EC2 API Toolsのインストール
$ wget "http://www.amazon.com/gp/redirect.html/ref=aws_rc_ec2tools?location=http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip&token=A80325AA4DAB186C80828ED5138633E3F49160D9"
$ unzip ec2-api-tools.zip
$ sudo mkdir -p /usr/local/ec2-api-tools
$ sudo cp -r ec2-api-tools-1.3-42584/* /usr/local/ec2-api-tools/
pem用ディレクトリ作成
$ sudo su root
# cd
# mkdir .ec2
# cd .ec2
# cp /home/user/*pem ./
profile設定
# emacs /etc/profile.d/ec2.sh
export EC2_HOME=/usr/local/ec2-api-tools
export PATH=$PATH:$JAVA_HOME/bin:$EC2_HOME/bin
export EC2_PRIVATE_KEY=/root/.ec2/pk-************.pem
export EC2_CERT=/root/.ec2/cert-************.pem
# source /etc/profile
# echo $EC2_HOME
/usr/local/ec2-api-tools
# ec2ver
1.3-42584 2009-08-15
# ec2-describe-instances
RESERVATION ********** ************ ************
INSTANCE ********** ************ ************************************ ************************ running ************ 0 m1.small 2008-08-15T06:42:04+0000 us-east-1a ************ ************ monitoring-disabled ************ ************