ページ

2012年4月5日木曜日

Sun Java 6 JDK をインストールできないなんて

いろいろと事情があるようで Sun Java 6 JDK がダウンロードできなくなっていたので、USB ディスクに入れていた Ubuntu のパッケージを取り込むようにしていたのですが、簡単に解決できる方法があるようなのでまとめてみました。他にもいろいろな方法があると思いますので、そのうちのひとつとして参考にしてください。

Windows 7 上の VMware 環境で作成しています。Ubuntu 11.10 (32-bit) 環境で必要なパッケージをダウンロードして、ビルド環境を構築します(なぜ 64-bit 版を使わないんだぁというツッコミはなしで)。

# Installing required packages

$ sudo apt-get install git-core gnupg flex bison gperf \
   
build-essential zip curl zlib1g-dev libc6-dev \
   libncurses5-dev x11proto-core-dev libx11-dev \
   libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
   libxml2-utils xsltproc

# JDK - Java Development Kit

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

Android-x86.org にもこのスタイルで記述がありますが、ここ最近 (3月下旬ぐらいから?)、このようなメッセージが表示されるようになりました。
とりあえず、次のように入力することで sun-java6-jdk をインストールできます。

# see also http://androidforums.com/computers/522019-can-anyone-get-java-jdk-install-lucid-lynx.html

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ferramroberto/java
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk sun-java6-plugin

最新の Sun Java 6 パッケージを作成してしまうという大ワザもあるようです。Martin Wimpress さんが作成した shell スクリプトを zip 形式でまるごとダウンロードして使います。ビルドされた deb パッケージは /var/local/oab ディレクトリにあります。

# see also https://github.com/flexiondotorg/oab-java6

$ sudo ~/bin/oab-java6.sh

注: 環境変数 PATH には ~/bin を含むように設定してください。
oab-java6.sh v0.1.9 - Create a local 'apt' repository for Ubuntu Java packages.
Copyright (c) Martin Wimpress, http://flexion.org. MIT License

By running this script to download Java you acknowledge that you have
read and accepted the terms of the Oracle end user license agreement.

* http://www.oracle.com/technetwork/java/javase/terms/license/

If you want to see what this is script is doing while it is running then execute
the following from another shell:

  tail -f /home/show/xmdroid/ics-x86/oab-java6.sh.log

Downloading common.sh
 [x] Installing Java build requirements success
 [x] Making build directories success
 [x] Removing clones of https://github.com/rraptorr/sun-java6 success
 [x] Cloning https://github.com/rraptorr/sun-java6 success
 [x] Checking out v6.31-2 success
 [x] Getting Java SE download pagesuccess
 [x] Getting current release download page success
 [x] Downloading jdk-6u31-linux-i586.bin : 81.34 MB success
 [x] Symlinking jdk-6u31-linux-i586.bin success
 [x] Downloading jdk-6u31-linux-x64.bin : 81.62 MB success
 [x] Symlinking jdk-6u31-linux-x64.bin success
 [x] Updating the changelog success
 [x] Building the packages success
 [x] Moving the packages success
 [x] Creating Packages.gz file success
 [x] Creating Release file success
 [x] Create GnuPG configuration success
 [x] Start generating entropy success
 [x] Creating signing key success
 [x] Stop generating entropy success
 [x] Signing the 'Release' file success
 [x] Exporting public key success
 [x] Adding public key success
 [x] Update package list success
All done!

進行状況の確認

上記メッセージにあるように、shell をもうひとつ立ち上げることで表示できます。
$ tail -f /home/show/xmdroid/ics-x86/oab-java6.sh.log

repo ツールをダウンロードします。

# repo tool

$ mkdir ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo


ソースをダウンロードします。

# initialize and synchronize

$ repo init -u http://git.android-x86.org/manifest -b ics-x86
$ repo sync -j4

ビルド環境を整備します。

#  setting environment variables

$ source build/envsetup.sh
あるいは
$ . build/envsetup.sh 

including device/amd/common/vendorsetup.sh
including device/asus/common/vendorsetup.sh
including device/hp/tx2500/vendorsetup.sh
including device/lenovo/s103t/vendorsetup.sh
including device/tegatech/tegav2/vendorsetup.sh
including sdk/bash_completion/adb.bash


ターゲットを選定します。

# target choice


You're building on Linux


Lunch menu... pick a combo:
     1. full-eng
     2. generic_x86-eng
     3. vbox_x86-eng
     4. amd_brazos-eng
     5. eeepc-eng
     6. asus_laptop-eng
     7. tx2500-eng
     8. s103t-eng
     9. tegav2-eng


Which would you like? [full-eng] 5


============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=eeepc
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=x86
TARGET_ARCH_VARIANT=x86
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================

準備はすべて整いました。Let's ビルド。

# Let's build the image of eeepc

$ make -j4 iso_img TARGET_PRODUCT=eeepc



そして待つこと、i3-540 で 2時間30分。でき上がった iso ファイルは次のディレクトリにあります。
$ ls -l ~/xmdroid/ics-x86/out/target/product/eeepc/eeepc.iso

あとは、この iso イメージを CD-R などに焼くか、VMware Player、VirtualBox、QEMU で動作させてみるかですね。

0 件のコメント:

コメントを投稿