Differences between revisions 41 and 42
Revision 41 as of 2016-07-04 21:48:35
Size: 4026
Editor: ConradPino
Comment:
Revision 42 as of 2016-07-04 22:07:43
Size: 4084
Editor: ConradPino
Comment: Complete Building Oracle Java 6 From jdk-6u45-linux-x64.bin
Deletions are marked like this. Additions are marked like this.
Line 79: Line 79:
 *Failure target is {{{override_dh_shlibdeps}}} as above

Translation(s): none


NOTE:

  • Debian recommends the use of OpenJDK packages (openjdk-7-jdk / openjdk-7-jre) instead of non-free packages created by this utility.


java-package provides the ability to build a Debian package from a Java binary distribution by running make-jpkg <java binary archive file> (with archive files downloaded from providers listed below). Should your interest be more on the development with Java under Debian, then follow the Java link. To learn more about the packaging of Java-written programs and libraries for Debian, see Teams/JavaPackaging.

The package includes the make-jpkg command to do this. Typical usage consists in:

  • downloading one of the java binary archive listed below
  • invoking make-jpkg to build a Debian package from the downloaded archive
  • installing the generated package

Supported Java binary distributions currently include:

Process

  1. Add a "contrib" component to /etc/apt/sources.list, for example:

    # Debian 8 "Jessie"
    deb http://httpredir.debian.org/debian/ jessie main contrib
  2. Update the list of available packages and install the java-package package:

    # apt-get update && apt-get install java-package && exit
  3. Download the desired Java JDK/JRE binary distribution (Oracle). Choose tar.gz archives or self-extracting archives, do not choose the RPM!

  4. Use java-package to create a Debian package, for example:

    $ make-jpkg jdk-8u51-linux-x64.tar.gz
  5. Install the binary package created:

    $ su
    # dpkg -i oracle-java8-jdk_8u51_amd64.deb

Configuration

By default the DebianAlternatives will automatically install the best version of Java as the default version. If the symlinks have been manually set they will be preserved by the tools. The update-alternatives tools try hard to respect explicit configuration from the local admin. Local manual symlinks appear to be an explicit configuration. In order to reset the alternative symlinks to their default value use the --auto option.

# update-alternatives --auto java

If you'd like to override the default to perhaps use a specific version then use --config and manually select the desired version.

# update-alternatives --display java
# update-alternatives --config java 

Choose the appropriate number for the desired alternative.

The appropriate java binary will automatically be in PATH by virtue of the /usr/bin/java alternative symlink.

You may also use the update-alternatives tool from java-common package which lets you update all alternatives belonging to one runtime/development kit at a time.

# update-java-alternatives -l
# update-java-alternatives -s jdk-8-oracle-x64

Troubleshooting

Building process keeps crashing on override_dh_shlibdeps target

This problems is due to missing dependencies of java-package package (related issue: 782132). To fix it simply run as root:

# apt-get install libgl1-mesa-glx libfontconfig1 libxslt1.1 libxtst6 libxxf86vm1 libgtk2.0-0

Building Oracle Java 6 From jdk-6u45-linux-x64.bin

  • Failure target is override_dh_shlibdeps as above

  • java-package versions 0.56 and 0.61 both have

    • Build-Depends: debhelper (>= 9), libasound2, libgl1-mesa-glx, libgtk2.0-0, libxslt1.1, libxtst6, libxxf86vm1

  • but omits libxt6

  • libfontconfig1 from above is not required

  • Build requires:

# apt-get install libgl1-mesa-glx libgtk2.0-0 libxslt1.1 libxtst6 libxxf86vm1 libxt6


CategoryJava