0

I have maven project with lib folder that contains some jars, In my pom.xml, I've added dependency accordingly like:

<dependency>
    <groupId>autoit</groupId>
    <artifactId>autoit</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/AutoItX4Java.jar</systemPath>
</dependency>

The problem is when I create a jar and run on cmd I get Exception:

nested exception is: java.lang.NoClassDefFoundError : AutoItX4Java...

If I run via eclipse there are no Errors.

Naman
  • 27,789
  • 26
  • 218
  • 353
Itai.A
  • 13
  • 5
  • 1
    Possible duplicate of [How can I create an executable JAR with dependencies using Maven?](http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) – M. Rizzo Dec 27 '16 at 16:15
  • 1. What command are you using on cmd? 2. Please share your complete stack trace and possible class structure in your project. – Naman Dec 27 '16 at 16:20
  • mvn assembly:single - creates jar – Itai.A Dec 28 '16 at 06:37
  • when i run the jar , my main is running. but when we reach to code that use my jar that under lib (AutoItX4Java.jar) , i get exception: Error occurred in server thread; nested exception is: java.lang.NoClassDefFoundError: autoitx4java/AutoItX – Itai.A Dec 28 '16 at 06:40

0 Answers0