Differences between revisions 11 and 24 (spanning 13 versions)
Revision 11 as of 2008-05-11 09:55:40
Size: 2665
Editor: EricLavarde
Comment: Add question about pbuilder and Sun's Java SDK
Revision 24 as of 2016-12-26 13:06:21
Size: 3431
Editor: Diego Alonso
Comment: added spanish translation link
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== About Blackdown Java and alternatives == #language en
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English~ [[es/JavaFAQ|español]]-
Line 3: Line 4:
=== Question === If you've questions about packaging Java Software for Debian, have a look at [[Java/Packaging]] and the [[JavaPackagingFAQ]].
Line 5: Line 6:
I want to install the ["Java"] runtime 1.4.1 from Blackdown and do
{{{
 [apt-get] install j2re1.4
}}}
== How get going with running and compiling Java programs in Debian real quick ==
Line 10: Line 8:
it escapes with an error message : {{{
 update-alternatives: unable to make /usr/lib/mozilla-cvs/plugins/javaplugin_oji.so.dpkg-tmp
 a symlink to /etc/alternatives/javaplugin_oji-mozilla-cvs.so: No such file or directory
}}}
In order to run java software you proboably need a jre package such as openjdk-6-jre. In order to compile java you need a jdk package such as openjdk-6-jdk. If you don't care which version of java is used, then default-jre and default-jdk are packages which exist on all platforms and give you something sensible.
Line 15: Line 10:
What is wrong? sudo apt-get install openjdk-6-jdk
Line 17: Line 12:
=== Answer === You reach java as /usr/bin/java . This file is really a link to /etc/alternatives/java , which in turn is a link to your java installation folder that's located in /usr/lib/jvm . For instance, java may link via /etc/alternatives/java to /usr/lib/jvm/java-6-openjdk/jre/bin/java .
Line 19: Line 14:
Seems that this error message happen when the directory {{{
 /usr/lib/mozilla-cvs/plugins
}}}
does not exist. According to debian-user maillist this has been reported as a bug, but a workaround exist{{{
 mkdir -p /usr/lib/mozilla-cvs/plugins
}}}
will make the install procedure continue without problem.
If you have more detailed questions, you may be interested in seeing [[http://www.debian.org/doc/manuals/debian-java-faq/]].
Line 27: Line 16:
See also:
 * http://www.debian.org/doc/manuals/debian-java-faq/
 * ["JavaScript"]
 * ["Mozilla"]
One particular reason that may lead your interest to read the tips above, is in case ant terminates for you with the error:

BUILD FAILED

(path)/build.xml:49: Unable to find a javac compiler;

com.sun.tools.javac.Main is not on the classpath.

Perhaps JAVA_HOME does not point to the JDK
Line 59: Line 54:
In http://lists.debian.org/debian-java/2008/05/msg00024.html Manuel Prinz says:
Line 60: Line 56:
I use a way to do that "on the fly" because I think it's easier to
manage if you have several debconf settings to manage. Just add to
your .pbuilderrc:
 I use a way to do that "on the fly" because I think it's easier to
 manage if you have several debconf settings to manage. Just add to
 your .pbuilderrc:
Line 64: Line 60:
{{{
HOOKDIR=$HOME/debian/pbuilder/hooks
}}}
 {{{
 HOOKDIR=$HOME/debian/pbuilder/hooks
 }}}
Line 68: Line 64:
The create a file called i.e. "D50sun-java-licenses" in $HOOKDIR with
the following content (it basically has to start with "D" and a two
digit number for ordering):
 The create a file called i.e. "D50sun-java-licenses" in $HOOKDIR with
 the following content (it basically has to start with "D" and a two
 digit number for ordering):
Line 72: Line 68:
{{{
#!/bin/sh
debconf-set-selections <<EOF
sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
EOF
}}}
 {{{
 #!/bin/sh
 debconf-set-selections <<EOF
 sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true
 sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
 EOF
 }}}
Line 80: Line 76:
This accepts the licenses before packages are installed. I prefer this
because I can deactivate certain settings easily (by commenting out
sections or renaming hook files) and do not have to keep a full chroot
for every possible debconf setting. Also, I tend to forget which exactly
setting I did in which chroot.
 This accepts the licenses before packages are installed. I prefer this
 because I can deactivate certain settings easily (by commenting out
 sections or renaming hook files) and do not have to keep a full chroot
 for every possible debconf setting. Also, I tend to forget which exactly
 setting I did in which chroot.

As mentioned in {{{man pbuilder}}}, you need to make the hook script (D50sun-java-licenses) executable before pbuilder will load it.

Translation(s): English~ español-

If you've questions about packaging Java Software for Debian, have a look at Java/Packaging and the JavaPackagingFAQ.

How get going with running and compiling Java programs in Debian real quick

In order to run java software you proboably need a jre package such as openjdk-6-jre. In order to compile java you need a jdk package such as openjdk-6-jdk. If you don't care which version of java is used, then default-jre and default-jdk are packages which exist on all platforms and give you something sensible.

sudo apt-get install openjdk-6-jdk

You reach java as /usr/bin/java . This file is really a link to /etc/alternatives/java , which in turn is a link to your java installation folder that's located in /usr/lib/jvm . For instance, java may link via /etc/alternatives/java to /usr/lib/jvm/java-6-openjdk/jre/bin/java .

If you have more detailed questions, you may be interested in seeing http://www.debian.org/doc/manuals/debian-java-faq/.

One particular reason that may lead your interest to read the tips above, is in case ant terminates for you with the error:

BUILD FAILED

(path)/build.xml:49: Unable to find a javac compiler;

com.sun.tools.javac.Main is not on the classpath.

Perhaps JAVA_HOME does not point to the JDK

About pbuilder and Sun's Java SDK

Question

I am build-depending on sun-javaX-jdk. However, I can't get an automatic build in a clean environment working, because sun-javaX-jdk does not install in a non-interactive environment, because it asks for license confirmation:

 Unpacking sun-java6-jdk (from .../sun-java6-jdk_6-06-1_amd64.deb) ...
 sun-dlj-v1-1 license could not be presented
 try 'dpkg-reconfigure debconf' to select a frontend other than noninteractive

Answer

There are two possible answers:

Patch one and for all your pbuilder environment

 $ sudo pbuilder login --save-after-login
 # echo "sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
 # echo "sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
 # exit

Add a hook to patch it on the fly

In http://lists.debian.org/debian-java/2008/05/msg00024.html Manuel Prinz says:

  • I use a way to do that "on the fly" because I think it's easier to manage if you have several debconf settings to manage. Just add to your .pbuilderrc:
     HOOKDIR=$HOME/debian/pbuilder/hooks
    The create a file called i.e. "D50sun-java-licenses" in $HOOKDIR with the following content (it basically has to start with "D" and a two digit number for ordering):
     #!/bin/sh
     debconf-set-selections <<EOF
     sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true
     sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
     EOF
    This accepts the licenses before packages are installed. I prefer this because I can deactivate certain settings easily (by commenting out sections or renaming hook files) and do not have to keep a full chroot for every possible debconf setting. Also, I tend to forget which exactly setting I did in which chroot.

As mentioned in man pbuilder, you need to make the hook script (D50sun-java-licenses) executable before pbuilder will load it.


CategoryJava