This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ Compile HSQLDB Problem.


Taufik Chowi wrote:
> Dear Andrew,
> 
> Thanks a lot.
> 
> i tried the code on my linux server (OS Fedora) , and yes it works...
> my development environment runs on Windows OS, and it didnt works...

> D:\gcc-4.3\bin>Test_HSQLDB.exe
> Exception in thread "main" java.sql.SQLException: Software module not installed
>    at org.hsqldb.jdbc.jdbcUtil.sqlException(Test_HSQLDB.exe)
>    at org.hsqldb.jdbc.jdbcConnection.<init>(Test_HSQLDB.exe)
>    at org.hsqldb.jdbcDriver.getConnection(Test_HSQLDB.exe)
>    at java.sql.DriverManager.getConnection(Test_HSQLDB.exe)
>    at java.sql.DriverManager.getConnection(Test_HSQLDB.exe)
>    at Test_HSQLDB.main(Test_HSQLDB.exe)
> 
> i dont get it. the gcj i used for my windows pc is version 4.3 (better version) then my server's gcj version 4.0
> used the same Test_HSQLDB.java and hsqldb.jar (exactly the same, i transfer all files from my windows to linux server)
> used the same gcj command for compiling and yet, it didnt run in windows.
> 
> do you know what might caused this problem?

I have duplicated your problem with the latest gcj on Linux.
I think it's a new bug caused by the reorganization of the compiler
for Java 1.6. The problem is that mixing .java and .jar files
in a compilation fails.

zorro:tmp $ gcj  /usr/share/java/hsqldb.jar ~/Test_HSQLDB.java --main=Test_HSQLDB -findirect-dispatch
zorro:tmp $ ./a.out
Exception in thread "main" java.lang.ClassNotFoundException: org.hsqldb.jdbcDriver not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.9)
   at java.lang.ClassLoader.loadClass(libgcj.so.9)
   at java.lang.ClassLoader.loadClass(libgcj.so.9)
   at java.lang.Class.forName(libgcj.so.9)
   at Test_HSQLDB.main(a.out)

Try compiling them separately, like this:

zorro:tmp $ gcj  /usr/share/java/hsqldb.jar -c -findirect-dispatch
zorro:tmp $ gcj  hsqldb.o ~/Test_HSQLDB.java --main=Test_HSQLDB -findirect-dispatch
zorro:tmp $ ./a.out
name = Gandhi
job = politics
name = Turing
job = computers
name = Wittgenstein
job = smartypants

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]