[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Request for review



On Wed Mar 25 19:53, Onkar Shinde wrote:
> On Wed, Mar 25, 2009 at 6:33 PM, Matthew Johnson <mjj29@debian.org> wrote:
> > On Wed Mar 25 18:17, Onkar Shinde wrote:
> >> > You still don't explicitly set which javac and jar program you are
> >> > using. You must use /usr/lib/jvm/default-jdk/bin/javac instead of javac
> >> > (or whichever path you are using). Also, I think the recommended depend
> >> > is actually default-jdk-builddep (I always forget that).
> >>
> >> Setting JAVA_HOME is the preferred way instead of using complete path for javac.
> >> default-jdk-builddep is to be used only when you are also creating a
> >> -gcj binary package.
> >
> > Setting JAVA_HOME doesn't help if you then call javac unqualified...
> 
> It works, believe me. You can check xml-commons-external package if you wish.
 
Really?

This would seem to suggest not:

$ javac -version
Eclipse Java Compiler v_774_R33x, 3.3.1, Copyright IBM Corp 2000, 2007. All rights reserved.
$ JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun javac -version
Eclipse Java Compiler v_774_R33x, 3.3.1, Copyright IBM Corp 2000, 2007. All rights reserved.
$ export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
$ javac -version
Eclipse Java Compiler v_774_R33x, 3.3.1, Copyright IBM Corp 2000, 2007. All rights reserved.
$ $JAVA_HOME/bin/javac -version
javac 1.5.0_17
javac: no source files

I also looked at xml-commons-external; if I use update-alternatives to point
javac to java-1.5.0-sun, then dpkg-buildpackage produces (trimmed):

   Note: org/w3c/dom/bootstrap/DOMImplementationRegistry.java uses unchecked or unsafe operations.
   Note: Recompile with -Xlint:unchecked for details.

whereas, with the alternative set to java-gcj it produces:

   ----------
   1. WARNING in org/w3c/css/sac/CSSException.java (at line 18)
      public class CSSException extends RuntimeException {
                   ^^^^^^^^^^^^
   The serializable class CSSException does not declare a static final serialVersionUID field of type long
   ----------
   ----------
   2. WARNING in org/w3c/css/sac/CSSParseException.java (at line 30)
      public class CSSParseException extends CSSException {
                   ^^^^^^^^^^^^^^^^^
   The serializable class CSSParseException does not declare a static final serialVersionUID field of type long
   ----------
   2 problems (2 warnings)

Clearly different behavior. The point of setting $JAVA_HOME is that
ant/javahelper will use that rather than what's on path and therefore there's
no difference. Just calling javac, however, will use whatever is on path. You
need to have $JAVA_HOME/bin/javac in debian/rules if you are going to do it by
hand.

If you were to use the new javahelper cdbs class you could almost certainly
replace everything with:

JH_BUILD_SRC=org
JH_BUILD_JAR=external.jar

and a debian/xml-commons-external.jlibs

Matt

-- 
Matthew Johnson

Attachment: signature.asc
Description: Digital signature


Reply to: