Home > Archive > PostgreSQL JDBC > September 2005 > GCJ jdbc driver compilation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author GCJ jdbc driver compilation
Gianluigi

2005-09-17, 7:23 am

Hi to all,
i have a problem: i'm trying to compile with GCJ a
java program that uses jdbc driver
(postgresql-8.0-311.jdbc3.jar ) under Mingw:
the program have that statement

Class.forName("org.postgresql.Driver");

i can compile it but when i try to execute it i have
that error:

java.lang. ClassNotFoundExcepti
on:
org.postgresql.Driver not found in [file:.\, core:/]

also if i try to set my CLASSPATH mingw shell variable
in the right way. I have also
postgresql-8.0-311.jdbc3.jar in the same directory of
executable.
So i try to force the loading of the class:

private static final Class class1 =
gnu.java.locale.Calendar.class;
private static final Class class2 =
gnu.java.locale.LocaleInformation.class;
private static final Class class4 =
org.postgresql.Driver.class;

but now the compiler fails at linking time:

$ gcj --main=PwServer PwServer.java -o pwserver
--classpath=/home/user/pwserver/

PwServer.java: In class `PwServer':
PwServer.java: In method `<clinit>()':
PwServer.java:30: error: Class `org.postgresql.Driver'
not found in type declaration.
private static final Class class4 =
org.postgresql.Driver.class;
^
1 error

user@JACOPOPC ~/pwserver
$ gcj --main=PwServer PwServer.java -o pwserver
--classpath=/home/user/pwserver/postgresql-8.0-311.jdbc3.jar

C:/DOCUME~1/user/IMPOST~1/Temp/cciEbaaa.o(.text+0xa48d):
In function `ZN8PwServer18__U3c_
clinit(unsigned e_E,
void)':
C:/Games/1.0/home/user/pwserver/PwServer.java:1:
undefined reference to
`org::postgresql::Dr
iver::class$'
C:/DOCUME~1/user/IMPOST~1/Temp/cciEbaaa.o(.text+0xa4fb):C:/Games/1.0/home/user/pwserver/PwServer.java:30:
undefined reference to
`org::postgresql::Dr
iver::class$'
C:/DOCUME~1/user/IMPOST~1/Temp/cciEbaaa.o(.text+0xa50e):C:/Games/1.0/home/user/pwserver/PwServer.java:30:
undefined reference to
`org::postgresql::Dr
iver::class$'
collect2: ld returned 1 exit status

So i try to compile the jdbc driver as a shared
library with that command:

# gcj --shared postgresql-8.0-311.jdbc3.jar -o
libpo.so

but the result is that:

org/postgresql/ssl/MakeSSL.java: In class
`org.postgresql.ssl.MakeSSL':
org/postgresql/ssl/MakeSSL.java: In method
`org.postgresql.ssl.MakeSSL.convert(org.postgresql.core.PGStream,java.util.Properties)':
org/postgresql/ssl/MakeSSL.java:27: error: cannot find
file for class javax.net.ssl.SSLSocketFactory
org/postgresql/ssl/MakeSSL.java:27: error: cannot find
file for class javax.net.ssl.SSLSocketFactory
org/postgresql/ssl/MakeSSL.java:37: error: cannot find
file for class javax.net.ssl.SSLSocketFactory
org/postgresql/ssl/MakeSSL.java:37: confused by
earlier errors, bailing out

At this time i dunno what to do............any
suggestion or help are very well accepted!!!
Thank,
Muzero from italy





____________________
_______________
Yahoo! Messenger: chiamate gratuite in tutto il mondo
http://it.messenger.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com