8

I've read in a couple of places that Derby/Java DB is included in Java SE 6, e.g. http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/beta2.html but I can't find anyone who has used it without installing it, including it on the classpath, etc.
What's going on? If it's included, why does everyone install another copy?

Whatsit
  • 10,227
  • 11
  • 42
  • 41

4 Answers4

7

You need the JDK, not the JRE.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
6

Yes, you need the JDK instead of the JRE. But after running into this same problem, I found that the JDK installer had placed Java DB (on my Windows XP environment) in C:\Program Files\Sun\JavaDB. You might want to check there, or whatever is equivalent in your environment.

I hope this helps any other people who might find themselves on this page. (Why does Java development have to be this frustrating?)

rdguam
  • 356
  • 5
  • 10
2

Database

For a great out-of-the-box development experience with database applications, the Java SE 6 development kit – though not the Java Runtime Environment (JRE) – co-bundles the all-Java JDBC database, Java DB based on Apache Derby. No more need to find and configure your own JDBC database when developing a database application! Developers will also get the updated JDBC 4.0, a well-used API with many important improvements, such as special support for XML as an SQL datatype and better integration of Binary Large OBjects (BLOBs) and Character Large OBjects (CLOBs) into the APIs.

From your link and JavaDB != Derby (which is an apache product).

  • 3
    From your link: `Java DB is Sun's supported distribution of the open source Apache Derby 100% Java technology database. It is fully transactional, secure, easy-to-use, standards-based SQL, JDBC API, and Java EE yet small, only 2.5 MB.` - http://www.oracle.com/technetwork/java/javadb/overview/index.html. Java DB FAQ: `2. Q: Is Java DB a fork of Apache Derby? A: No, Java DB is Sun's supported version of Apache Derby and contains the same binaries as Apache Derby.` – Bert F Jan 20 '11 at 20:23
  • "Sun supported" it sounds like a fork to me specially considering the actual climate with Oracle and stuff –  Jan 20 '11 at 20:32
  • 1
    no, "supported" means that Sun will accept bugreports and even try to fix them if found in the version distributed instead of just saying "go away". Note that the binaries are identical. – Thorbjørn Ravn Andersen Jan 20 '11 at 21:33
2

It's "included" in that the code is part of the JDK download, but the Derby jars aren't automatically placed on the classpath because not every Java app needs Derby. The Derby (JavaDB) jars that are included in the JDK download are fine for use in any J2SE java app you might write, and you certainly don't need to install another copy, just put those jars into your classpath for those apps for which it is appropriate.

Bryan Pendleton
  • 16,128
  • 3
  • 32
  • 56