たぷつきません

おなかがでてきた。もうたぷついてるやん。

JDK5インストール

 debianのaptにはsunのjavaパッケージがない(配布ライセンスの問題?)ようです。普通にインストールするのはdebian的によくないらしいので少々手間が掛かります。概要としてはaptにパッケージ配布元を追加して、sunのJDKと組み合わせてdebianパッケージを作成して、それをdpkgでインストールといった手順です。ここに具体的に行った作業を残しておきます。

aptの準備

  • /etc/apt/sources.listを開き以下を追加して保存します。
#java
deb http://ftp.us.debian.org/debian sarge main contrib non-free
  • apt-get update を実行します。
  • apt-get install java-package を実行します。途中で2MBほどのディスクスペースを使うことを確認されます。Yを入力して完了まで待ちます。

jdkのダウンロード

  • Mozillaを開きます。
  • http://java.sun.com/j2se/1.5.0/download.jsp に移動します。
  • 「Download JDK 5.0 Update 6」のリンクをクリック
  • ライセンスに同意します。(acceptクリック)
  • Linux self-extracting file」をクリック。
  • ファイル保存先を ~/setup/ とします(root以外のユーザーです)。
  • ダウンロード完了まで待ちます。

パッケージ化

 fakeroot make-jpkg ~/setup/ダウンロードしたファイル名(jdk-1_5_0*.bin) を実行します。以下の質問に Y と答えて続行します。

Detected product:
    Java(TM) Software Development Kit (J2SDK)
    Standard Edition, Version 1.5.0+update06
    Sun Microsystems(TM), Inc.
Is this correct [Y/n]: 

 以下の質問に名前を入力してください。

Please enter your full name. This value will be used in the maintainer
field of the created package.
    
Full name [root]:

 以下の質問にメールアドレスを入力してください。

Please enter a valid email address or press return to accept the
default value. This address will be used in the maintainer field of
the created package.
    
Email [root@localhost.localdomain]:

 以下は Enterで続行します。

In the next step, the binary file will be extracted. Probably a
license agreement will be displayed. Please read this agreement
carefully. If you do not agree to the displayed license terms, the
package will not be built.
    
Press [Return] to continue: 

 JDKのライセンスが表示されていきます。スペースバーでスクロールしてください。最後に了解するか聞かれますので yes を入力してください。

    Do you agree to the above license terms? [yes or no] 

 展開作業が完了するまで待ちます。

ようやくインストール

 終了すると、カレントディレクトリに、debianパッケージファイルが作成されています。たとえばそれは、sun-j2sdk1.5_1.5.0+update06_i386.deb といった名前です。このパッケージファイルをDebianに登録します。これには root権限が必要ですのでsuしてから行ってください。実行が終わればインストール完了です。

  $ su
  Password
  # dpkg -i sun-j2sdk1.5_1.5.0+update06_i386.deb
  
  Selecting previously deselected package sun-j2sdk1.5.
  (Reading database ... 97188 files and directories currently installed.)
  Unpacking sun-j2sdk1.5 (from sun-j2sdk1.5_1.5.0+update06_i386.deb) ...
  Setting up sun-j2sdk1.5 (1.5.0+update06) ...

確認

 java -version を実行してください。1.5.0*** というバージョンが表示されればOKです。

$ java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)