ここでは、JDK 1.5.0_06 をインストールする。

Package: java-package (0.24) [contrib]

Debian -- java-package

/etc/apt/sources.list に contrib が必要。


# cat /etc/apt/sources.list
deb http://www.ring.gr.jp/archives/linux/debian/debian/ stable main contrib
deb-src http://www.ring.gr.jp/archives/linux/debian/debian/ stable main contrib
deb http://security.debian.org/ stable/updates main contrib

java-package パッケージをインストール。


# apt-get update
# apt-get upgrade
# apt-get install java-package
# exit
logout

fakeroot make-jpkg で Java のパッケージを作成する。
Full name と Email を聞かれる(maintainer field 用)が、そのまま何も入力せずに Enter.


$ fakeroot make-jpkg ./jdk-1_5_0_06-linux-i586.bin
Creating temporary directory: /tmp/make-jpkg.XXXXabcDef
Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk.sh j2se.sh sun-j2re.sh sun-j2sdk.sh
 
Detected product:
    Java(TM) Software Development Kit (J2SDK)
    Standard Edition, Version 1.5.0+update06
    Sun Microsystems(TM), Inc.
Is this correct [Y/n]: y
 
Checking free diskspace: done.
 
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]:
 
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:
 
 
Sun Microsystems, Inc. Binary Code License Agreement
(中略)
Do you agree to the above license terms? [yes or no]
yes
(中略)
The Debian package has been created in the current directory. You can
install the package as root (e.g. dpkg -i sun-j2sdk1.5_1.5.0+update06_i386.deb).

root にて、作成した Java パッケージをインストール。


# dpkg -i ./sun-j2sdk1.5_1.5.0+update06_i386.deb
Selecting previously deselected package sun-j2sdk1.5.
(Reading database ... 29048 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) ...

インストールされていることを確認。


# dpkg -l | grep j2sdk
ii  sun-j2sdk1.5   1.5.0+update06 Java(TM) 2 SDK, Standard Edition, Sun Micros

Ref. Debian辞典 220ページ

fakeroot を使わないと失敗する

以前に、fakeroot を使わず sun-j2sdk1.4 パッケージを作成しようとしたら失敗した。JDK1.5系でもたぶん同様。


# make-jpkg ./j2sdk-1_4_2_10-linux-i586.bin
You are real root -- unfortunately, some Java distributions have
install scripts that directly manipulate /etc, and may cause some
inconsistencies on your system. Instead, you should become a
non-root user and run:
 
fakeroot make-jpkg ./j2sdk-1_4_2_10-linux-i586.bin
 
which will allow no damage to be done to your system files and
still permit the Java distribution to successfully extract.
 
Aborting.

コメント

あれ、なんで Java 5_07 はインストールできないんだろう……

> $ fakeroot make-jpkg ./jdk-1_5_0_07-linux-i586-rpm.bin
> Creating temporary directory: /tmp/make-jpkg.XXXXXXXXXX
> Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk.sh j2se.sh sun-j2re.sh sun-j2sdk.sh
>
> No matching plugin was found.
> Removing temporary directory: done

って、よく見たら、RPMじゃん! ショック!

http://java.sun.com/j2se/1.5.0/ja/download.html
Java 2 Platform Standard Edition 5.0 のダウンロード

tags: zlashdot Linux Debian

Posted by NI-Lab. (@nilab)