gcj on Nexenta OS

Khaled Mohammed khaled.mohammed@gmail.com
Mon Mar 5 04:57:00 GMT 2007


Hi,

I am using the Alpha 6 version of Nexenta and the following gcj version:
khaled@myhost:~/java.src$ gcj --version
gcj (GCC) 4.1.0 (GNU_OpenSolaris 4.1.0-1nexenta8)

I have tried the following simple example:
import java.io.*;

public class HelloWorld {
        public static void main(String [] args) {
                System.out.println("Hello " + args[0]);
        }
}

Example is compiled using:
khaled@myhost:~/java.src$ gcj -g HelloWorld.java -o hello --main=HelloWorld

The example compiles without any error both to bytecode and native binary.

bytecode seems to run fine under sun jre but the native code crashes.
Here is the output under gdb:

khaled@myhost:~/java.src$ gdb hello
(gdb) run khaled
Starting program: /export/home/khaled/java.src/hello khaled
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074
warning: Lowest section in /lib/librt.so.1 is .dynamic at 00000074

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()

I would appreciate any advice on debugging this problem.

Thanks,
-- 
- Khaled



More information about the Java mailing list