W3C home > Mailing lists > Public > public-qa-dev@w3.org > January 2007

Re: Packaging CSS Validator and Command line

From: Jean-Guilhem Rouel <jean-gui@w3.org>
Date: Tue, 09 Jan 2007 21:34:11 +0100
Message-ID: <45A3FC43.30709@w3.org>
To: olivier Thereaux <ot@w3.org>
Cc: Yves Lafon <ylafon@w3.org>, Karl Dubost <karl@w3.org>, QA Dev <public-qa-dev@w3.org>

olivier Thereaux a écrit :
> 
> 
> On Jan 9, 2007, at 18:41 , Jean-Guilhem Rouel wrote:
>> During my first internship I created a new command line appl. The main 
>> class is org.w3c.css.css.CssValidator.
>>
>> java org.w3c.css.css.CssValidator --help
>>
>> Calling java -jar css-validator.jar won't use this class but the 
>> previous appl and won't probably work. It shouldn't be too hard to 
>> adapt the build.xml to use the new class.
> 
> I did that, thanks for noticing it. Still facing the same issue with 
> NoClassDefFoundError: org/w3c/tools/resources/ProtocolException but at 
> least the main class is properly set up.

Yes, as Yves told me earlier, you need to set the classpath in the jar's 
manifest. To do that, you can try to add something like:
<manifest>
    <attribute name="Main-Class" value="org.w3c.css.css.CssValidator"/>
    <attribute name="Class-Path" value="file1.jar file2.jar"/>
</manifest>
Replacing fileN.jar with all the jars needed by the CSS Validator. After 
that, re-build css-validator.jar, copy all the libs in the same dir, and 
try again a java -jar css-validator.jar. I don't like the fact that you 
need to specify where the libs are in the manifest, but I don't know if 
there's another way to load the libs.

Another possibility would be to add css-validator.jar to the classpath, 
doing something like:
java -classpath $CLASSPATH:css-validator.jar org.w3c.css.css.CssValidator

Jean-Gui

> thank you!
> --olivier
> 
Received on Tuesday, 9 January 2007 20:34:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 19 August 2010 18:12:47 GMT