Unix Technical Forum

GCJ jdbc driver compilation

This is a discussion on GCJ jdbc driver compilation within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Hi to all, i have a problem: i'm trying to compile with GCJ a java program that uses jdbc ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 11:38 PM
Gianluigi
 
Posts: n/a
Default GCJ jdbc driver compilation

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.ClassNotFoundException:
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:ostgresql:river::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:ostgresql:river::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:ostgresql:river::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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:46 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com