ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver on OS X Yosemite

372 views Asked by At

I use the version of Java 7 that comes with OS X Yosemite. My understanding is that Oracle by now ships Java DB (i.e. Derby) with Java, so perhaps I have it already installed.

I currently get a ClassNotFoundException when attempting Class.forName("org.apache.derby.jdbc.EmbeddedDriver").

Am I supposed to somehow add the driver from a local directory, or do I have to get it extra (e.g. because OS X comes with a JRE but not JDK)?

If the second is true, where should I get it from (i.e. are there any differences between drivers from Apache and Oracle)?

1

There are 1 answers

0
Mark Rotteveel On BEST ANSWER

Although Derby (or JavaDB) is installed together with the JDK (at least with Java 7, not sure if they still do with Java 8), it is not part of Java itself. This means you still need to include it in the classpath yourself.