Re: GCJ and MySQL Connector for Java

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2005-11-20 at 17:10 +0200, Spyros Stathopoulos wrote:
>   I compile it succesfully with gcj as following
>   gcj -o MySQL-Test --main=org.testing.TestConnectMySQL -classpath
> /usr/share/java/mysql-connector-java.jar:.
> src/org/testing/TestConnectMySQ
> L.java
> 
>  However when I am trying to execute the output program I get the
> following error:
> 
>  Cannot load driver:
>  java.lang.ClassNotFoundException: com.mysql.jdbc.Driver not found in
> gnu.gcj.runtime.SystemClassLoader{urls=[file:./,file:./],
> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}

Your program isn't finding the mysql-connector-java code.  There are
lots of ways to fix this:

1. Compile mysql-connector-java.jar to native code and force it into the
MySQL-Test link; or..

2. On Linux, compile mysql-connector-java.jar into lib-com-mysql-jdbc.so
and make sure the runtime linker can find it (perhaps by setting
LD_LIBRARY_PATH); or...

3. Set your CLASSPATH environment variable to point at
mysql-connector-java.jar before running MySQL-Test; or...

4. Do [3] and also set up a mapping between the .jar file and a
native .so using gcj-dbtool; or...

5. If you're using Fedora Core 4 or better, just download, build and
install the mysql connector source RPM from here:
http://people.redhat.com/green/FC/ , then do [3].  It will use a
natively compiled version at runtime.

AG



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux