* Re: GCJ Compile HSQLDB Problem.
[not found] <431007.91848.qm@web54602.mail.re2.yahoo.com>
@ 2008-09-12 10:03 ` Andrew Haley
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Haley @ 2008-09-12 10:03 UTC (permalink / raw)
To: Taufik Chowi; +Cc: GCJ
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GCJ Compile HSQLDB Problem.
@ 2008-09-12 3:21 Taufik Chowi
0 siblings, 0 replies; 4+ messages in thread
From: Taufik Chowi @ 2008-09-12 3:21 UTC (permalink / raw)
To: java
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...
i plan to buy JavaNativeCompiler (which run very well on windows and it used gcj 4.3 too), but it didnt work too
and i have tried compiling using your gcj command, the same thing happened , run time error occured , here is the error message
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?
again thanks a lot, now i can finally see something that will work on my project :)
and yeah let us forget the sqlite T.T (since we cant compile it)
Cheers and God Bless,
Chowi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GCJ Compile HSQLDB Problem.
2008-09-10 11:12 Taufik Chowi
@ 2008-09-11 12:25 ` Andrew Haley
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Haley @ 2008-09-11 12:25 UTC (permalink / raw)
To: Taufik Chowi; +Cc: java
Taufik Chowi wrote:
> to run this well in with java, you have to download HSQLDB 1.7.2.11 http://downloads.sourceforge.net/hsqldb/hsqldb_1_7_2_11.zip?modtime=1103945242&big_mirror=0
> if you have downloaded the file, you need to extract them, and at lib folders, you can find servlet.jar and hsqldb.jar , put it in your jre/lib/ext folder
>
> the code above run with no problem with JVM and Excelsior JET
Works for me:
zebedee:~ $ gcj Test_HSQLDB.java --main=Test_HSQLDB -findirect-dispatch /usr/share/java/hsqldb.jar
zebedee:~ $ ./a.out
name = Gandhi
job = politics
name = Turing
job = computers
name = Wittgenstein
job = smartypants
zebedee:~ $ gcj --version
gcj (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)
zebedee:~ $ rpm -qf /usr/share/java/hsqldb.jar
hsqldb-1.8.0.4-3jpp.4
Andrew.
^ permalink raw reply [flat|nested] 4+ messages in thread
* GCJ Compile HSQLDB Problem.
@ 2008-09-10 11:12 Taufik Chowi
2008-09-11 12:25 ` Andrew Haley
0 siblings, 1 reply; 4+ messages in thread
From: Taufik Chowi @ 2008-09-10 11:12 UTC (permalink / raw)
To: java
Test_HSQLDB.java
import java.sql.*;
public class Test_HSQLDB {
public static void main(String[] args) throws Exception {
Class.forName("org.hsqldb.jdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:hsqldb:test.db");
Statement stat = conn.createStatement();
stat.executeUpdate("drop table if exists people;");
stat.executeUpdate("create table people (id INTEGER IDENTITY , name VARCHAR(256), occupation VARCHAR(256));");
PreparedStatement prep = conn.prepareStatement("insert into people (name, occupation) values (?, ?);");
prep.setString(1, "Gandhi");
prep.setString(2, "politics");
prep.addBatch();
prep.setString(1, "Turing");
prep.setString(2, "computers");
prep.addBatch();
prep.setString(1, "Wittgenstein");
prep.setString(2, "smartypants");
prep.addBatch();
conn.setAutoCommit(false);
prep.executeBatch();
conn.setAutoCommit(true);
ResultSet rs = stat.executeQuery("select * from people;");
while (rs.next()) {
System.out.println("name = " + rs.getString("name"));
System.out.println("job = " + rs.getString("occupation"));
}
rs.close();
stat.execute("SHUTDOWN");
conn.close();
}
}
to run this well in with java, you have to download HSQLDB 1.7.2.11 http://downloads.sourceforge.net/hsqldb/hsqldb_1_7_2_11.zip?modtime=1103945242&big_mirror=0
if you have downloaded the file, you need to extract them, and at lib folders, you can find servlet.jar and hsqldb.jar , put it in your jre/lib/ext folder
the code above run with no problem with JVM and Excelsior JET
but it has so many runtime problem with gcj, and yes i know this is because i am very new with gcj so yeah i will be learning a lot from this mailing list =))
here is what i type to compile this code using gcj , if i am wrong please let me know (just in case if i have made any syntax error)
(I put servlet.jar , hsqldb.jar and Test_HSQLDB.java in gcc-4.3\bin folder , because i dont know any better way xD , please englighten me if there are any better way of doing this)
D:\gcc-4.3\bin>gcj -fjni -O2 -c servlet.jar hsqldb.jar Test_HSQLDB.java -o Test_HSQLDB.o
D:\gcc-4.3\bin>gcj --main=Test_HSQLDB -o Test_HSQLDB Test_HSQLDB.o
it generate a file named Test_HSQLDB.exe , and no error
BUT
runtime error occured when we run Test_HSQLDB.exe
Exception in thread "main" java.sql.SQLException: Software module not installed
at org.hsqldb.jdbc.jdbcUtil.sqlException(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
at org.hsqldb.jdbc.jdbcConnection.<init>(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
at org.hsqldb.jdbcDriver.getConnection(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
at java.sql.DriverManager.getConnection(/datal/gcc/gcc/libjava/classpath/java/sql/DriverManager.java:166)
at java.sql.DriverManager.getConnection(/datal/gcc/gcc/libjava/classpath/java/sql/DriverManager.java:205)
at Test_HSQLDB.main(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
i have tried googling "Software Module Not Installed" , or "HSQLDB GCJ" , but i didnt find any good answer
i know i have done some silly mistake , perhaps somewhere around the command i used for compiling... but i dont know what T.T (and i dont have enough money to implement my project using JET Excelsior) T.T
oh btw, this is my first post , please be nice xD
Thanks a lot
Cheers and God Bless,
Chowi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-09-12 10:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <431007.91848.qm@web54602.mail.re2.yahoo.com>
2008-09-12 10:03 ` GCJ Compile HSQLDB Problem Andrew Haley
2008-09-12 3:21 Taufik Chowi
-- strict thread matches above, loose matches on Subject: below --
2008-09-10 11:12 Taufik Chowi
2008-09-11 12:25 ` Andrew Haley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).