# Exception in thread "main" java.lang.NoClassDefFoundError:

**URL:** https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038
**Category:** General Discussion
**Created:** [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038 "2019-09-20T20:20:00Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![un76311462149678082r](https://avatars.discourse-cdn.com/v4/letter/u/5f9b8f/32.png) [@un76311462149678082r](https://forum.liquibase.org/u/un76311462149678082r)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/1 "2019-09-20T20:20:00Z")

</div>

I had included the self4j-api.1.7.25 as external jar when I had build it but still same error.&nbsp;

Also tried the following too

D:\Liquibase3.8.0\>set path=%path%;D:\Liquibase3.8.0\lib;

---

<div class="post-metadata">

### Author: ![Kiru.srini](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kiru.srini](https://forum.liquibase.org/u/Kiru.srini)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/2 "2019-09-20T20:20:00Z")

</div>

java -jar ./liquibase.jar --driver=com.oracle.ojdbc8 --classpath=“C:\Users\A054804.m2\repository\com\oracle\ojdbc8\12.2.0.1\ojdbc8-12.2.0.1.jar;F:\Liquibase\liquibase\target\liquibase-0.0.1-SNAPSHOT.jar”&nbsp; --changeLogFile=database.changelog-master.xml&nbsp; --url=“jdbc:oracle:thin:@host:1521:service”&nbsp; &nbsp; --username=db11&nbsp; --password=password update

Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.logging.core.Slf4JLoggerFactory.getLog(Slf4JLoggerFactory.java:9)

&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.logging.LogService.getLog(LogService.java:39)

&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.integration.commandline.Main.(Main.java:62)

Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

&nbsp; &nbsp; &nbsp; &nbsp; at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

&nbsp; &nbsp; &nbsp; &nbsp; at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

&nbsp; &nbsp; &nbsp; &nbsp; at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

&nbsp; &nbsp; &nbsp; &nbsp; at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

&nbsp; &nbsp; &nbsp; &nbsp; … 3 more

---

<div class="post-metadata">

### Author: ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/3 "2019-09-20T20:20:00Z")

</div>

Rather than calling java directly, it is much easier to use the provided liquibase.bat file that ships with the liquibase zip file. That batch file will automatically build your classpath using the liquibase jar and all the jars that are in the lib directory. The java executable itself does not allow you to add a path to a directory to the classpath, it expects that every entry on the classpath refers to a specific jar file.&nbsp;

I also suggest that you put the parameters that don’t change very often into a liquibase.properties file in your project directory to save typing an possible errors.&nbsp;

Steve Donie  
Principal Software Engineer  
Datical, Inc. [http://www.datical.com/](http://www.datical.com/)

---

<div class="post-metadata">

### Author: ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/4 "2019-09-20T20:20:00Z")

</div>

One way to see would be to edit the liquibase.bat file. The last line in liquibase.bat looks like this:

  

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; version to STDOUT

  
Steve Donie  
Principal Software Engineer  
Datical, Inc. [http://www.datical.com/](http://www.datical.com/)

---

<div class="post-metadata">

### Author: ![un1398357527727r51id](https://avatars.discourse-cdn.com/v4/letter/u/da6949/32.png) [@un1398357527727r51id](https://forum.liquibase.org/u/un1398357527727r51id)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/5 "2019-09-20T20:20:00Z")

</div>

Let us know if that resolves the issue.

---

<div class="post-metadata">

### Author: ![un1398357527727r51id](https://avatars.discourse-cdn.com/v4/letter/u/da6949/32.png) [@un1398357527727r51id](https://forum.liquibase.org/u/un1398357527727r51id)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/6 "2019-09-20T20:20:00Z")

</div>

Once again, Steve coming through with the real answers. Thanks, Steve!!!

---

<div class="post-metadata">

### Author: ![un1398357527727r51id](https://avatars.discourse-cdn.com/v4/letter/u/da6949/32.png) [@un1398357527727r51id](https://forum.liquibase.org/u/un1398357527727r51id)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/7 "2019-09-20T20:20:00Z")

</div>

Roger. Spoke with Steve today and he’s got you covered below. We should always listen to him and not me.&nbsp;

---

<div class="post-metadata">

### Author: ![un76311462149678082r](https://avatars.discourse-cdn.com/v4/letter/u/5f9b8f/32.png) [@un76311462149678082r](https://forum.liquibase.org/u/un76311462149678082r)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/8 "2019-09-20T20:20:00Z")

</div>

liquibase&nbsp; &nbsp;--classpath=“C:\Users\Axxx.m2\repository\com\oracle\ojdbc8\12.2.0.1\ojdbc8-12.2.0.1.jar;D:\Liquibase\liquibase\target\liquibase-0.0.1-SNAPSHOT.jar”&nbsp; &nbsp; &nbsp;--changeLogFile=database.changelog-master.xml&nbsp; --url=“jdbc:oracle:thin:@hostname:1521:a043168”&nbsp; &nbsp; --username=user–password=password update

the above stuff works.&nbsp;

How do i make it work with java?

java -jar ./liquibase.jar --driver=com.oracle.ojdbc8 --classpath=“C:\Users\A054804.m2\repository\com\oracle\ojdbc8\12.2.0.1\ojdbc8-12.2.0.1.jar;F:\Liquibase\liquibase\target\liquibase-0.0.1-SNAPSHOT.jar”&nbsp; --changeLogFile=database.changelog-master.xml&nbsp; --url=“jdbc:oracle:thin:@host:1521:service”&nbsp; &nbsp; --username=db11&nbsp; --password=password update

---

<div class="post-metadata">

### Author: ![un76311462149678082r](https://avatars.discourse-cdn.com/v4/letter/u/5f9b8f/32.png) [@un76311462149678082r](https://forum.liquibase.org/u/un76311462149678082r)
#### Post date: [September 20, 2019, 8:20pm UTC](https://forum.liquibase.org/t/exception-in-thread-main-java-lang-noclassdeffounderror/4038/9 "2019-09-20T20:20:00Z")

</div>

No it didn’t resolve the issue.&nbsp;
