GCJ and JDBC

Radu Racaru radu.racaru@gmail.com
Tue May 17 16:43:00 GMT 2005


On 5/17/05, Amir Bukhari <ufz6@rz.uni-karlsruhe.de> wrote:
> 
> And is this problem is stopped or you have gave up!
> 
> BTW:
> When I don't use HSQlDB (that mean my application has no JDBC) then it work
> fine. 

i think that this is from static linking versus classforname thingy
you must use to load the driver. you could have a reference to the
driver explicitly declared on your code as a field.
like: 
org.hsqldb.jdbcDriver driver;



>SWT work wonderful with GCJ. Only one thing I don't like, is that SWT
> application have dos console opened with them!

add "-mwindows" to your link parameters
> 
> -Amir
> 
> -----Original Message-----
> From: java-owner@gcc.gnu.org [mailto:java-owner@gcc.gnu.org] On Behalf Of
> Linuxhippy
> Sent: Tuesday, May 17, 2005 5:49 PM
> To: java@gcc.gnu.org
> Subject: Re: GCJ and JDBC
> 
> I had the same problem with GCC-3.3.1 and Hsqldb a while ago.
> Sorry I do not have more information, neither a debug-libgcj installed :-(
> 
> lg Clemens
> 
> >I have installed a binary from this site:
> >http://www.thisiscool.com/gcc_mingw.htm
> >
> >and copied all files to my MinGW installation DIR.
> >
> >Here is my makefile:
> >
> >######## BEGIN of Makefile ############
> ># Generated by Eclipse GCJ Builder
> ># http://gcjbuilder.sf.net
> >
> >#      global targets
> >ALL:   main
> >all:   main
> >
> >#      gcj variable
> >GCJ=gcj  $(OPTLEVEL) $(DEBUGLEVEL) $(COMPILER_OPTIONS)
> >
> >#      binary output folder
> >BINOUT= bin
> >
> >#      compiler options
> >COMPILER_OPTIONS=
> >
> >#      linker options
> >LINKER_OPTIONS=
> >
> >#      object list
> >OBJ=.... a lot of files
> >
> >#      jar objects
> >CPOBJ=
> >
> >#      jar so
> >CPSO=
> >
> >#      project classpath
> >CP="--classpath=./;"
> >
> >#      main class (or so output)
> >MAINCLASS=--main=com.khsitecafe.gui.MySWT
> >
> >#      binary name (exe or so)
> >BIN=$(BINOUT)/swtExample
> >
> >#      library path list
> >LIBRARYPATH=-L $(BINOUT)
> >
> >#      libraries (so) list
> >LIBRARIES=
> >
> >#      resource objects list
> >RESOB=
> >
> >#      compiler optimization level
> >OPTLEVEL= -O0
> >
> >#      compiler debug level
> >DEBUGLEVEL= -g
> >
> >
> >#      object targets
> >%.o:   %.java
> >       $(GCJ) $(CP)  -c $? -o $@
> >
> >##################
> >#      dummy targets (depend on config)
> >
> >#      classpath objects target
> >
> >
> >#      classpath so target
> >
> >
> >#      resource objects target
> >
> >
> >
> >#################
> >
> >
> >#      main target
> >
> >main: setup $(CPOBJ) $(RESOB) $(OBJ) $(CPSO)
> >       $(GCJ) $(LINKER_OPTIONS) $(MAINCLASS) $(CPOBJ) $(RESOB) $(OBJ)
> >-o$(BIN)   $(LIBRARYPATH) $(LIBRARIES)
> >
> >#      setup output folders
> >setup:
> >       mkdir -p $(BINOUT)/resource
> >
> >#      clean target
> >clean:
> >       rm -f `find . -name "*.o"`
> >       rm -r $(BINOUT)
> >
> >######## END of Makefile ############
> >
> >-----Original Message-----
> >From: Andrew Haley [mailto:aph@redhat.com]
> >Sent: Tuesday, May 17, 2005 3:27 PM
> >To: Amir Bukhari
> >Cc: java@gcc.gnu.org
> >Subject: Re: GCJ and JDBC
> >
> >Amir Bukhari writes:
> > > I have successfully compiled HSQLDB as part of my project (based on
> SWT).
> >It
> > > run without problem in JVM. But when I run the executable I get
> > > SEGV. Here is the trace of the program:
> > >
> > > Program received signal SIGSEGV, Segmentation fault.
> > > 0x005480b7 in _Jv_CheckAccess(java::lang::Class*, java::lang::Class*,
> >int)
> > > ()
> > > (gdb) backtrace 20
> > > #0  0x005480b7 in _Jv_CheckAccess(java::lang::Class*,
> java::lang::Class*,
> > > int)
> > >     ()
> > > #1  0x0061ad18 in
> > > java::lang::reflect::Constructor::newInstance(JArray<java::la
> > > g::Object*>*) ()
> >
> >This is very weird.  It looks like your libgcj is perhaps missing
> >debug information -- you should be able to see some arguments for the
> >method newInstance.
> >
> >This should work.  Tell us more about how you installed gcj.
> >
> >Andrew.
> >
> >
> >
> >
> 
>



More information about the Java mailing list