HowTo build the Java package version 1.5.0 Update 4
by Markus Kolb <ubuntu-ml -at- tower-net.de>, Dec 26th 2004
edited by Seth Kinast, July 16 2005
The Ubuntu package java-package does not support the latest Java versions from Sun. You have to change a few files in your editor. Here it is what you need and what you have to edit.
Needed packages for Java packagebuild and support
First install Ubuntu's packages fakeroot, java-package and java-common.
sudo aptitude install fakeroot java-package java-common
Note that java-package resides in the multiverse repository, see [WWW] http://www.ubuntulinux.org/support/docu ... 414506543/
for help on adding the multiverse repository to your apt sources.
Go to [WWW] http://java.sun.com/j2se/1.5.0/download.jsp
and download the self-extracting Linux files (that end in .bin).
Changes to java-package files
Skip this step if you're running Ubuntu Hoary.
Change to the directory /usr/share/java-package/.
Look in the file sun-j2sdk.sh for the part with:
j2se_expected_min_size=122 # 125899 kB
Now add between this part and the "esac" following new lines:
For the Java Runtime Environment you have to edit sun-j2re.sh.
Go now below the part
j2se_expected_min_size=81 # 83267 kB
and add in front of the "esac":
Please do not run the package build with real root rights because the Sun installer would install some not necessary files with absolute file paths in your system without package builder control!
fakeroot make-jpkg --full-name "<Your name>" --email "<Your email>" jdk-1_5_0_04-linux-i586.bin
fakeroot make-jpkg --full-name "<Your name>" --email "<Your email>" jre-1_5_0_04-linux-i586.bin
and follow the instructions on screen.
Note: the build may fail with this error:
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
This is due to a bug in dpkg-architecture on newer systems. Run dpkg-architecture and find the line similar to:
Next, run sudoedit /usr/share/java-package/sun-j2sdk.sh (or sun-j2re.sh) and change line 6 from i386-linux to your architecture (most commonly i486-linux-gnu).
The Debian/Ubuntu package has been created in the current directory. You can install the package as root (e.g. sudo dpkg -i sun-j2sdk1.5_1.5.0+update04_i386.deb).