FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Java

 
 
LinkBack Thread Tools
 
Old 01-17-2012, 08:23 AM
Andreas Tille
 
Default Help with CLASSPATH needed (Was: Need help with packaging: ...)

On Mon, Jan 16, 2012 at 10:50:51PM +0100, Ludovic Claude wrote:
>
> javahelper is a generic collection of scripts for building Java sources,
> packaging them into a jar and building a Debian package.
>
> maven-debian-helper is designed for upstream projects which use Maven as
> their build tool. The upstream project should contain at leat one
> pom.xml file, and the upstream sources should compile using the command
> 'mvn install'.
>
> So if your project doesn't build with Maven, the choice is easy: use
> javahelper.

I followed this hint and made some progress when using plain debuild.
However, when trying to use pbuilder something seems to be missing.
According to the Build log hint I added ant-optional but that's probably
not enough.

> Can you post the url or the sources for the Options project, I cannot
> help you further without this information.

As I said there is no homepage but I updated my private repository at

http://people.debian.org/~tille/packages/options/

with *.dsc file. The build log says:

BUILD FAILED
/tmp/buildd/liboptions-java-0.0.20120113/nbproject/build-impl.xml:919: The following error occurred while executing this line:
/tmp/buildd/liboptions-java-0.0.20120113/nbproject/build-impl.xml:341: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath

So I tried several approaches.

1. Add to build.xml
<property name="javac.classpath" value="/usr/share/java/junit.jar"/>
as well as
<property name="javac.classpath" value="/usr/share/java/ant-junit.jar"/>
(see patch in debian/patches)
Both variants did not help.

2. Add to debian/rules
CLASS_PATH := /usr/share/java/jdom1.jar:/usr/share/ant/lib/ant-junit.jar
as well as
export CLASSPATH=/usr/share/java/jdom1.jar:/usr/share/ant/lib/ant-junit.jar
Both variants did not help and BTW, I have read both CLASS_PATH as
well as "export CLASSPATH" in debian/rules files and I'm confused which
one to use.

The result for all these tests is the same. Any hint how to properly
specify junit.jar to be found by build system in pbuilder?

Any help is welcome

Andreas.


--
http://fam-tille.de


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120117092359.GG21451@an3as.eu">http://lists.debian.org/20120117092359.GG21451@an3as.eu
 
Old 01-17-2012, 08:30 AM
Olivier Sallou
 
Default Help with CLASSPATH needed (Was: Need help with packaging: ...)

Le 1/17/12 10:23 AM, Andreas Tille a écrit :
> On Mon, Jan 16, 2012 at 10:50:51PM +0100, Ludovic Claude wrote:
>> javahelper is a generic collection of scripts for building Java sources,
>> packaging them into a jar and building a Debian package.
>>
>> maven-debian-helper is designed for upstream projects which use Maven as
>> their build tool. The upstream project should contain at leat one
>> pom.xml file, and the upstream sources should compile using the command
>> 'mvn install'.
>>
>> So if your project doesn't build with Maven, the choice is easy: use
>> javahelper.
> I followed this hint and made some progress when using plain debuild.
> However, when trying to use pbuilder something seems to be missing.
> According to the Build log hint I added ant-optional but that's probably
> not enough.
>
>> Can you post the url or the sources for the Options project, I cannot
>> help you further without this information.
> As I said there is no homepage but I updated my private repository at
>
> http://people.debian.org/~tille/packages/options/
>
> with *.dsc file. The build log says:
>
> BUILD FAILED
> /tmp/buildd/liboptions-java-0.0.20120113/nbproject/build-impl.xml:919: The following error occurred while executing this line:
> /tmp/buildd/liboptions-java-0.0.20120113/nbproject/build-impl.xml:341: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath
>
> So I tried several approaches.
>
> 1. Add to build.xml
> <property name="javac.classpath" value="/usr/share/java/junit.jar"/>
> as well as
> <property name="javac.classpath" value="/usr/share/java/ant-junit.jar"/>
> (see patch in debian/patches)
> Both variants did not help.

in nbproject/build-impl.xml, classpath does not use the same variable to
set classpath:

<classpath>
<path path="${run.test.classpath}"/>
</classpath>

So you should set a new property like javac.classpath but with name
run.test.classpath.
I don't know if junit or ant-junit.jar should be used, but junit.jar
should be ok.

Could be something like:

<property name="javac.classpath" value="/usr/share/java/junit.jar:/usr/share/java/jdom1.jar
"/>



> 2. Add to debian/rules
> CLASS_PATH := /usr/share/java/jdom1.jar:/usr/share/ant/lib/ant-junit.jar
> as well as
> export CLASSPATH=/usr/share/java/jdom1.jar:/usr/share/ant/lib/ant-junit.jar
> Both variants did not help and BTW, I have read both CLASS_PATH as
> well as "export CLASSPATH" in debian/rules files and I'm confused which
> one to use.
>
> The result for all these tests is the same. Any hint how to properly
> specify junit.jar to be found by build system in pbuilder?
>
> Any help is welcome
>
> Andreas.
>
>

--
Olivier Sallou
IRISA / University of Rennes 1
Campus de Beaulieu, 35000 RENNES - FRANCE
Tel: 02.99.84.71.95

gpg key id: 4096R/326D8438 (pgp.mit.edu)
Key fingerprint = 5FB4 6F83 D3B9 5204 6335 D26D 78DC 68DB 326D 8438



--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4F153FC5.9060400@irisa.fr">http://lists.debian.org/4F153FC5.9060400@irisa.fr
 
Old 01-17-2012, 09:11 AM
Andreas Tille
 
Default Help with CLASSPATH needed (Was: Need help with packaging: ...)

On Tue, Jan 17, 2012 at 10:30:45AM +0100, Olivier Sallou wrote:
> Could be something like:
>
> <property name="javac.classpath" value="/usr/share/java/junit.jar:/usr/share/java/jdom1.jar
> "/>

You probably mean:

<property name="run.test.classpath" value="/usr/share/java/jdom1.jar:/usr/share/java/ant-junit.jar"/>

or something like this. I tried different ways of doing this but
failed (always with same result.

What is astonishing to me is the fact that debuild is building
successfully but pdebuild is not. Usually this is a sign of missing
Build-Depends but not of missing patches. When following this idea I
realised that adding Build-Depends: junit is the solution for this
problem.

I'll leave the explanation what might be the difference between
ant-junit.jar and junit.jar and why it seems impossible to tweak
a valid CLASSPATH into the build system without patching it to
some of the mysteries of Java packaging.

Kind regards and thanks for your hints anyway

Andreas.

--
http://fam-tille.de


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120117101115.GH21451@an3as.eu">http://lists.debian.org/20120117101115.GH21451@an3as.eu
 
Old 01-17-2012, 09:44 PM
Ludovic Claude
 
Default Help with CLASSPATH needed (Was: Need help with packaging: ...)

> what might be the difference between ant-junit.jar and junit.jar

ant-junit.jar is an extension for Ant which provides the <junit> task to
Ant. It relies on junit.jar to provide the actual JUnit classes used to
run the tests.

> why it seems impossible to tweak a valid CLASSPATH into the build
system without patching it

You could have use:

override_jh_build:
ant -Djavac.classpath=/usr/share/java/junit.jar:/usr/share/java/jdom1.jar

The author of Options made life simple for himself, leaving the
packaging of his project to the default build system provided by
Netbeans, but it's quite a complex Ant script not easily amendable to
the kind of customizations required for Debian packaging.

Ludovic

On 17/01/2012 11:11, Andreas Tille wrote:
> On Tue, Jan 17, 2012 at 10:30:45AM +0100, Olivier Sallou wrote:
>> Could be something like:
>>
>> <property name="javac.classpath" value="/usr/share/java/junit.jar:/usr/share/java/jdom1.jar
>> "/>
>
> You probably mean:
>
> <property name="run.test.classpath" value="/usr/share/java/jdom1.jar:/usr/share/java/ant-junit.jar"/>
>
> or something like this. I tried different ways of doing this but
> failed (always with same result.
>
> What is astonishing to me is the fact that debuild is building
> successfully but pdebuild is not. Usually this is a sign of missing
> Build-Depends but not of missing patches. When following this idea I
> realised that adding Build-Depends: junit is the solution for this
> problem.
>
> I'll leave the explanation what might be the difference between
> ant-junit.jar and junit.jar and why it seems impossible to tweak
> a valid CLASSPATH into the build system without patching it to
> some of the mysteries of Java packaging.
>
> Kind regards and thanks for your hints anyway
>
> Andreas.
>


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4F15F9B6.8020102@laposte.net">http://lists.debian.org/4F15F9B6.8020102@laposte.net
 
Old 01-18-2012, 06:29 AM
Andreas Tille
 
Default Help with CLASSPATH needed (Was: Need help with packaging: ...)

On Tue, Jan 17, 2012 at 11:44:06PM +0100, Ludovic Claude wrote:
> You could have use:
>
> override_jh_build:
> ant -Djavac.classpath=/usr/share/java/junit.jar:/usr/share/java/jdom1.jar

Just out of academical interest I tried this but failed:

-do-compile:
[mkdir] Created dir: /tmp/buildd/liboptions-java-0.0.20120113/build/empty
[mkdir] Created dir: /tmp/buildd/liboptions-java-0.0.20120113/build/generated-sources/ap-source-output
[javac] Compiling 12 source files to /tmp/buildd/liboptions-java-0.0.20120113/build/classes
[javac] Options.java:206: package org.jdom does not exist
[javac] public Options(String args[], java.io.Reader reader) throws org.jdom.JDOMException {
[javac] ^
[javac] Options.java:355: package org.jdom does not exist
[javac] private void addOptions(OptionSet set, org.jdom.Element element) {
...


Kind regards

Andreas.

--
http://fam-tille.de


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120118072940.GA7146@an3as.eu">http://lists.debian.org/20120118072940.GA7146@an3as.eu
 

Thread Tools




All times are GMT. The time now is 01:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org