Compiling with mysql

Marco Trudel marco@mtsystems.ch
Thu Aug 21 20:28:00 GMT 2008


ezer wrote:
> I am using JavaNativeCompiler from windows and also gcj form ubuntu
>> 1) When i delete the references to com.mysql and the mysql lib from the
> project, i can compile without problems.
>> 2)
> I tryed to include a class as sugested in some place:
> public class ForceInclude {
> 	private static final Class class1 = com.mysql.jdbc.Driver.class;
>> 	ForceInclude() {
> 	}
> }

There's no problem with not included classes here. So that's not needed.
> 3) Compiling with JavaNativeCompiler from windows generating code only for
> linux
> "undefined reference to `java::util::Iterator*
> java::sql::SQLException::iterator()"

You are still providing insufficient information to efficiently help 
you. What version of JavaNativeCompiler are you using? What version of 
mysql? Where can it be downloaded? How did you compile?
Guessing all this, I now took
- JNC v1.1.1 with gcc-122233-win (compiles for Windows)
- MySQL Connector/J 5.1 from http://dev.mysql.com/downloads/#connector-j
and tried to compiled the jar. java.sql.SQLClientInfoException does not 
yet exist in GCJ (indeed it's quite new that class).
So, downgraded to MySQL Connector/J 5.0. Here some com.mchange classes 
and org.jboss classes are missing. Using -findirect-dispatch helps here 
and should solve the problem (I guess these classes are never needed at 
runtime since a Sun JRE doesn't have them either).
> 4) Compiling the same file from ubuntu with gcj compiler containing lib 
> libgcj-4.2.jar i get:
> cannot find file for class java.sql.Connection

This class exists in recent GCJs. What version are you using? Please update.
Again: Please, always add all information so that people willing to help 
you can fully reproduce the problem.
Hope that helps
Marco


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /