Differences between revisions 37 and 38
Revision 37 as of 2013-08-30 19:23:46
Size: 3449
Editor: ?DaxMickelson
Comment:
Revision 38 as of 2013-11-29 21:46:27
Size: 3642
Editor: GeoffSimmons
Comment: Expand and update example package generation process, de-sudoify.
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
 * java-package 0.50 is a revamped version available for [[DebianWheezy|Wheezy]].  * java-package 0.50 is a revamped version available for [[DebianWheezy|Debian 7 "Wheezy"]].
Line 8: Line 8:
 * Debian recommends the use of [[DebianPkg:openjdk-6-jdk]] / [[DebianPkg:openjdk-6-jre]] or [[DebianPkg:openjdk-7-jdk]] / [[DebianPkg:openjdk-7-jre]] which are packaged and available in all Debian flavours.  * Debian recommends the use of OpenJDK ([[DebianPkg:openjdk-6-jdk]] / [[DebianPkg:openjdk-6-jre]] or [[DebianPkg:openjdk-7-jdk]] / [[DebianPkg:openjdk-7-jre]]) which is packaged and available in all Debian releases.
Line 11: Line 11:
DebianPkg: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). DebianPkg: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).
Line 14: Line 14:
The package includes the 'make-jpkg' command to do this. The package includes the [[DebianMan:1/make-jpkg|make-jpkg]] command to do this.
Line 25: Line 25:
 (Choose tar.gz archives or self-extracting archives, do _not_ choose the RPM!)
Line 31: Line 30:
== Process ==
Line 32: Line 32:
== Process ==
{{{
apt-get install java-package}}} -- This doesn't work as you cannot then use "make-jpkg" as root yet the non-root user can't "apt-get install". Instead download the correct tar.gz file from http://www.oracle.com/technetwork/java/javase/downloads/index.html

 (see [[DebianPackageManagement]], note that java-package is not in the {{{main}}} sources, you need to add {{{contrib}}} to your {{{/etc/apt/sources.list}}})

{{{
make-jpkg jdk-7u2-linux-x64.tar.gz

dpkg -i oracle-j2sdk1.7_1.7.0+update2_amd64.deb
 1. Add a "contrib" component to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 7 "Wheezy"
deb http://http.debian.net/debian/ wheezy main contrib
}}}
 1. Update the list of available packages and install the DebianPkg:java-package package: {{{
# apt-get update && apt-get install java-package && exit
}}}
 1. Download the desired Java JDK/JRE binary distribution ([[http://www.oracle.com/technetwork/java/javase/downloads/index.html|Oracle]]). Choose tar.gz archives or self-extracting archives, do __not__ choose the RPM!
 1. Use java-package to create a Debian package, for example: {{{
$ make-jpkg jdk-7u45-linux-x64.tar.gz
}}}
 1. Install the binary package created: {{{
$ su
# dpkg -i oracle-j2sdk1.7_1.7.0+update45_amd64.deb
Line 53: Line 57:
sudo update-alternatives --auto java # update-alternatives --auto java
Line 59: Line 63:
update-alternatives --display java
sudo update-alternatives --config java
# update-alternatives --display java
# update-alternatives --config java
Line 70: Line 74:
sudo update-java-alternatives -l
sudo update-java-alternatives -s j2sdk1.7-oracle
# update-java-alternatives -l
# update-java-alternatives -s j2sdk1.7-oracle

Translation(s): none


NOTE:


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:


NOTE: All other previously supported JVM (Blackdown, IBM, ..) have been removed and will only be added back on users demand.


Process

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

    # Debian 7 "Wheezy"
    deb http://http.debian.net/debian/ wheezy 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-7u45-linux-x64.tar.gz
  5. Install the binary package created:

    $ su
    # dpkg -i oracle-j2sdk1.7_1.7.0+update45_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 as well use the update-alternatives tool from java-common package which let you update all alternatives belonging to one runtime or development kit at a time.

# update-java-alternatives -l
# update-java-alternatives -s j2sdk1.7-oracle


CategoryJava