Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 16:45:54 -0600
From:      Guy Helmer <guy.helmer@gmail.com>
To:        freebsd-java@freebsd.org
Subject:   Does gcj work?
Message-ID:  <CA%2B537dG3Z2=N=qMKg5ujg03diq6V=Z9O_Hy4z_4hb_ON-tSqfg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I have been trying to get HelloWorld.java to work when compiled with gcj47
on both i386 and amd64. Seems like it should work. This code:

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

compiled thus:
redwater:~ (515) gcj47 --main=HelloWorld -o HelloWorld HelloWorld.java

always croaks:
redwater:~ (516) ./HelloWorld
Abort (core dumped)

redwater:~ (517) gdb751 HelloWorld HelloWorld.core
...
(gdb) where
#0  0x2a4b573b in thr_kill () from /lib/libc.so.7
#1  0x2a42f986 in ?? () from /lib/libthr.so.3
#2  0x2a43005b in raise () from /lib/libthr.so.3
#3  0x2a55e04a in abort () from /lib/libc.so.7
#4  0x28b4b08f in _Jv_Throw (value=0xbfbfd894)
    at ../.././../gcc-4.7-20130119/libjava/exception.cc:128
#5  0x28b892a8 in java::lang::Class::forName (className=0x844b9c0,
    initialize=1 '\001', loader=0x0)
    at ../.././../gcc-4.7-20130119/libjava/java/lang/natClass.cc:108
#6  0x28b9ac67 in java.lang.Class.forName(java.lang.String,
java.lang.Class)java.lang.Class (className=@844b9c0, caller=@29fb6c80)
    at ../.././../gcc-4.7-20130119/libjava/java/lang/Class.java:133
#7  0x28fd457e in java.net.URLClassLoader.addURLImpl(java.net.URL)void (
    this=this@entry=@845afa0, newUrl=newUrl@entry=@8449c80)
    at
/usr/ports/lang/gcc47/work/gcc-4.7-20130119/libjava/classpath/java/net/URLClassLoader.java:332
#8  0x28fd4c83 in java.net.URLClassLoader.addURL(java.net.URL)void
(this=@845afa0,
    newUrl=@8449c80)
    at
/usr/ports/lang/gcc47/work/gcc-4.7-20130119/libjava/classpath/java/net/URLClassLoader.java:281
#9  0x28ba83e4 in gnu.gcj.runtime.SystemClassLoader.init()void
(this=@845afa0)
    at
/usr/ports/lang/gcc47/work/gcc-4.7-20130119/libjava/gnu/gcj/runtime/SystemClassLoader.java:89
---Type <return> to continue, or q <return> to quit---
#10 0x28babed5 in gnu.gcj.runtime.ExtensionClassLoader.initialize()void ()
    at
/usr/ports/lang/gcc47/work/gcc-4.7-20130119/libjava/gnu/gcj/runtime/ExtensionClassLoader.java:33
#11 0x28b3f600 in _Jv_CreateJavaVM (vm_args=vm_args@entry=0x0)
    at ../.././../gcc-4.7-20130119/libjava/prims.cc:1670
#12 0x28b3fb38 in _Jv_RunMain (vm_args=0x0,
    klass=klass@entry=0x8049240 <HelloWorld::class$>, name=name@entry=0x0,
    argc=argc@entry=1, argv=argv@entry=0xbfbfdb98, is_jar=is_jar@entry
=false)
    at ../.././../gcc-4.7-20130119/libjava/prims.cc:1720
#13 0x28b3fea2 in _Jv_RunMain (klass=klass@entry=0x8049240
<HelloWorld::class$>,
    name=name@entry=0x0, argc=argc@entry=1, argv=argv@entry=0xbfbfdb98,
    is_jar=is_jar@entry=false) at
../.././../gcc-4.7-20130119/libjava/prims.cc:1815
#14 0x28b3ff3b in JvRunMain (klass=0x8049240 <HelloWorld::class$>, argc=1,
    argv=0xbfbfdb98) at ../.././../gcc-4.7-20130119/libjava/prims.cc:1821
#15 0x08048ad9 in main ()

Any ideas?

Thanks,
Guy



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B537dG3Z2=N=qMKg5ujg03diq6V=Z9O_Hy4z_4hb_ON-tSqfg>