SQLClientInfoException / Linux
I am running a java program that establishes a database connection to a SQL database. It works fine on Mac OS X, but when I try to run the same code on Linux, I get an exception on the "main" thread java.lang.NoClassDefFoundError: java / sql / SQLClientInfoException.
I am using jdk-1.6.0_02 - if I unzip src.zip it turns out that SQLClientInfoException.java is not contained in it.
Also, the API documentation shows that there are only two methods that use this exception, as in java.sql.Connection. However, if I look at both methods in the source code, they both seem to use the more general SQLException instead.
Is this a bug in my java version or am I doing something wrong?
SQLClientInfoException is new in Java 1.6 and must be present in src.zip. I have it jdk1.6.0_03
on Windows and jdk1.6.0_06
Linux and the class is included in both. Try upgrading to the latest version.
Make sure you are actually running the Sun JDK and not the GCJ version that comes standard on many Linux distributions. This version is a little outdated and prone to such strange bugs.
NoClassDefFoundError: "The definition of the search class was executed when the executable class was compiled, but the definition can no longer be found." (from API docs).
This class appears to be part of the standard jdk distribution. There is probably an error in your path, or something in the program is hardcoded in the path that does not point to the correct location in Linux.