You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "David Nault (JIRA)" <ji...@apache.org> on 2009/08/15 03:16:14 UTC

[jira] Issue Comment Edited: (HTTPCLIENT-866) HttpClient depends on jcip-annotations.jar

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743509#action_12743509 ] 

David Nault edited comment on HTTPCLIENT-866 at 8/14/09 6:15 PM:
-----------------------------------------------------------------

The issue is not about building HttpClient; it's about using Java 5 to compile code that *uses* httpclient-4.0.jar. If you use Java 5 and HttpClient, you need the JCIP annotation jar in your classpath at compile time. Try it :-) Presumably this is because those annotations have runtime retention.

I think it would be ideal if consumers of HttpClient didn't need this jar. Second best would be to include it in the HttpClient distribution.



      was (Author: dnault_laszlo):
    The issue is not about building HttpClient; it's about using Java 5 to compile code that *uses* httpclient-4.0.jar. If you use Java 5 and HttpClient, you need the JCIP annotation jar in your classpath at compile time. Try it :-) Presumably this is because those annotations have runtime retention.

I think it would be ideal if consumers of HttpClient didn't need this jar. Second best would be to include it in the "with-dependencies" distribution.


  
> HttpClient depends on jcip-annotations.jar
> ------------------------------------------
>
>                 Key: HTTPCLIENT-866
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-866
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0 Final
>         Environment: javac 1.5.0_19
>            Reporter: David Nault
>
> When using Java 5 to compile code that uses HttpClient, jcip-annotations.jar must be in the classpath or else you get a compiler error:
>     [javac] /path/to/src/SomeFile.java:129: cannot access net.jcip.annotations.GuardedBy
>     [javac] file net/jcip/annotations/GuardedBy.class not found
>     [javac]         DefaultHttpClient httpclient = new DefaultHttpClient();
>     [javac]                                        ^
> With Java 6, you get a bunch of warnings instead.
>     [javac] org/apache/http/impl/client/AbstractHttpClient.class(org/apache/http/impl/client:AbstractHttpClient.class): warning: Cannot find annotation method 'value()' in type 'net.jcip.annotations.GuardedBy': class file for net.jcip.annotations.GuardedBy not found
> This requirement doesn't seem to be documented anywhere, and jcip-annotations.jar is not included in the "httpcomponents-client-4.0-bin-with-dependencies" package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org