You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Raivo Rebane <ra...@r-systems.ee> on 2020/10/31 09:33:13 UTC

Fwd: exec:java don't find existing class

Hello

I run following command:

mvn exec:java -Dexec.mainClass="SolrJExample" -X

and get following error :

java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient

I use projct repo and dependencies is:

         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpclient</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>solrj</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>httpcore</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>codec</artifactId>
           <version>1.0</version>
         </dependency>

         <dependency>
           <groupId>lib</groupId>
           <artifactId>logging</artifactId>
           <version>1.0</version>
         </dependency>

Command seems uses them:

[DEBUG] Adding project dependency artifact: solrj to classpath
[DEBUG] Adding project dependency artifact: httpclient to classpath
[DEBUG] Adding project dependency artifact: httpcore to classpath
[DEBUG] Adding project dependency artifact: codec to classpath
[DEBUG] Adding project dependency artifact: logging to classpath

httpclient contains jar what contains following classes screenshot attached

Why java don't find them ?

Regars

Raivo