Problems compiling Java-Prog with gcj using JavaMail (mail.jar) and JAF (activation.jar)

Discussion in 'Java' started by Matthias Griem, Feb 7, 2008.

  1. Hello,

    i tried to compile a small Programm with gcj - no success :-( (using eclipse it works!!):

    gcj --classpath=mail.jar:activation.jar -v --main=lantronix.mail.MailSender MailSender.java -o MailSender

    Result:

    Using built-in specs.
    Reading specs from /usr/lib/gcc/i586-suse-linux/4.2.1/libgcj.spec
    rename spec startfile to startfileorig
    rename spec lib to liborig
    Target: i586-suse-linux
    Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.2.1 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --program-suffix=-4.2 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=i586-suse-linux
    Thread model: posix
    gcc version 4.2.1 (SUSE Linux)
    /usr/lib/gcc/i586-suse-linux/4.2.1/jc1 MailSender.java -fhash-synchronization -fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fkeep-inline-functions -quiet -dumpbase MailSender.java -mtune=generic -auxbase MailSender -g1 -version -fclasspath=mail.jar:activation.jar -o /tmp/cclqviOf.s
    GNU Java version 4.2.1 (SUSE Linux) (i586-suse-linux)
    compiled by GNU C version 4.2.1 (SUSE Linux).
    GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129464
    Class path starts here:
    mail.jar/ (zip)
    activation.jar/ (zip)
    /usr/share/java/libgcj-4.2.1.jar/ (system) (zip)
    /usr/lib/gcc/i586-suse-linux/4.2.1/../../../../i586-suse-linux/bin/as -V -Qy -o /tmp/ccanivAm.o /tmp/cclqviOf.s
    GNU assembler version 2.17.50 (i586-suse-linux) using BFD version (GNU Binutils) 2.17.50.20070726-14 (SUSE Linux)
    /usr/lib/gcc/i586-suse-linux/4.2.1/jvgenmain lantronix.mail.MailSendermain /tmp/ccXuLquw.i
    /usr/lib/gcc/i586-suse-linux/4.2.1/cc1 /tmp/ccXuLquw.i -quiet -dumpbase lantronix.mail.MailSendermain.c -mtune=generic -g1 -version -fdollars-in-identifiers -o /tmp/cclqviOf.s
    GNU C version 4.2.1 (SUSE Linux) (i586-suse-linux)
    compiled by GNU C version 4.2.1 (SUSE Linux).
    GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129464
    Compiler executable checksum: d37fc6ca38af22df55d43dce99bbeccf
    /usr/lib/gcc/i586-suse-linux/4.2.1/../../../../i586-suse-linux/bin/as -V -Qy -o /tmp/cchBffHx.o /tmp/cclqviOf.s
    GNU assembler version 2.17.50 (i586-suse-linux) using BFD version (GNU Binutils) 2.17.50.20070726-14 (SUSE Linux)
    /usr/lib/gcc/i586-suse-linux/4.2.1/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o MailSender /usr/lib/gcc/i586-suse-linux/4.2.1/../../../crt1.o /usr/lib/gcc/i586-suse-linux/4.2.1/../../../crti.o /usr/lib/gcc/i586-suse-linux/4.2.1/crtbegin.o -L/usr/lib/gcc/i586-suse-linux/4.2.1 -L/usr/lib/gcc/i586-suse-linux/4.2.1 -L/usr/lib/gcc/i586-suse-linux/4.2.1/../../../../i586-suse-linux/lib -L/usr/lib/gcc/i586-suse-linux/4.2.1/../../.. /tmp/cchBffHx.o /tmp/ccanivAm.o -lgcc_s -lgcc -lgcj -lm -lpthread -lrt -lz -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i586-suse-linux/4.2.1/crtend.o /usr/lib/gcc/i586-suse-linux/4.2.1/../../../crtn.o
    /tmp/ccanivAm.o: In function `void lantronix::mail::MailSender::doSend()':
    MailSender.java:(.text+0x108): undefined reference to `javax::mail::Session* javax::mail::Session::getDefaultInstance(java::util::properties*, javax::mail::Authenticator*)'
    MailSender.java:(.text+0x141): undefined reference to `void javax::mail::Session::setDebug(bool)'
    MailSender.java:(.text+0x148): undefined reference to `javax::mail::internet::MimeMessage::class$'
    MailSender.java:(.text+0x177): undefined reference to `javax::mail::internet::MimeMessage::MimeMessage(javax::mail::Session*)'
    MailSender.java:(.text+0x1a4): undefined reference to `javax::mail::internet::InternetAddress::class$'
    MailSender.java:(.text+0x1d3): undefined reference to `javax::mail::internet::InternetAddress::InternetAddress(java::lang::String*)'
    MailSender.java:(.text+0x220): undefined reference to `javax::mail::internet::InternetAddress::class$'
    MailSender.java:(.text+0x24f): undefined reference to `javax::mail::internet::InternetAddress::InternetAddress(java::lang::String*)'
    MailSender.java:(.text+0x27f): undefined reference to `javax::mail::Message$RecipientType::class$'
    MailSender.java:(.text+0x28d): undefined reference to `javax::mail::Message$RecipientType::TO'
    MailSender.java:(.text+0x303): undefined reference to `javax::mail::internet::InternetAddress::class$'
    MailSender.java:(.text+0x326): undefined reference to `javax::mail::internet::InternetAddress::InternetAddress(java::lang::String*)'
    MailSender.java:(.text+0x34a): undefined reference to `javax::mail::Message$RecipientType::class$'
    MailSender.java:(.text+0x354): undefined reference to `javax::mail::Message$RecipientType::CC'
    MailSender.java:(.text+0x425): undefined reference to `void javax::mail::Transport::send(javax::mail::Message*)'
    MailSender.java:(.text+0x46a): undefined reference to `javax::mail::MessagingException::class$'
    /tmp/ccanivAm.o:(.data+0xc4): undefined reference to `javax::mail::Session::class$'
    /tmp/ccanivAm.o:(.data+0xd4): undefined reference to `javax::mail::Message::class$'
    /tmp/ccanivAm.o:(.rodata+0x40): undefined reference to `javax::mail::MessagingException::class$'
    collect2: ld returned 1 exit status
    matthias@amax:~/workspace/zumTesten/src/lantronix/mail>

    anyone with more experience using gcj ??


    thanks for help

    Matthias
     
    Matthias Griem, Feb 7, 2008
    #1
    1. Advertising

  2. Matthias Griem

    DBloke Guest

    Re: Problems compiling Java-Prog with gcj using JavaMail (mail.jar)and JAF (activation.jar)

    Matthias Griem wrote:
    Looks like a missing classpath problem from first sight, afraid I know
    little about GCJ.

    Hope this helps
    DB
     
    DBloke, Feb 7, 2008
    #2
    1. Advertising

  3. Matthias Griem

    DBloke Guest

    Re: Problems compiling Java-Prog with gcj using JavaMail (mail.jar)and JAF (activation.jar)

    Hi Matthias,

    Ok sorry I did notice one other thing I am not sure it is relevant but
    below it looks like there is a disable flag for libgjc "--disable-libgcj"

    not sure if this helps?

    Configured with: ../configure --enable-threads=posix --prefix=/usr
    --with-local-prefix=/usr/local --infodir=/usr/share/info
    --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
    --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
    --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.2.1
    --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib
    --with-system-zlib --enable-shared --enable-__cxa_atexit
    --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
    --program-suffix=-4.2 --enable-version-specific-runtime-libs
    --without-system-libunwind --with-cpu=generic --host=i586-suse-linux
     
    DBloke, Feb 7, 2008
    #3
  4. Matthias Griem

    Mark Space Guest

    Re: Problems compiling Java-Prog with gcj using JavaMail (mail.jar)and JAF (activation.jar)

    Matthias Griem wrote:
    >>GNU Java version 4.2.1 (SUSE Linux) (i586-suse-linux)
    >> compiled by GNU C version 4.2.1 (SUSE Linux).
    >> GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129464
    >> Class path starts here:
    >> mail.jar/ (zip)
    >> activation.jar/ (zip)
    >> /usr/share/java/libgcj-4.2.1.jar/ (system) (zip)
    >> /usr/lib/gcc/i58

    >
    > 8< snap:


    It really does appear that there is a third .jar (at least) that is not
    found:

    MailSender.java:(.text+0x108): undefined reference to
    `javax::mail::Session*


    So MailSender can't find javax.mail.Seseion package.
     
    Mark Space, Feb 7, 2008
    #4
  5. DBloke wrote:

    > Hi Matthias,
    >
    > Ok sorry I did notice one other thing I am not sure it is relevant but
    > below it looks like there is a disable flag for libgjc "--disable-libgcj"
    >
    > not sure if this helps?
    >
    > Configured with: ../configure --enable-threads=posix --prefix=/usr
    > --with-local-prefix=/usr/local --infodir=/usr/share/info
    > --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
    > --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
    > --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.2.1
    > --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib
    > --with-system-zlib --enable-shared --enable-__cxa_atexit
    > --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
    > --program-suffix=-4.2 --enable-version-specific-runtime-libs
    > --without-system-libunwind --with-cpu=generic --host=i586-suse-linux



    sorry, iforgot to mention that the usual 'HelloWorld' can be compiled and
    run successfully.

    there must be something else, probably compile/link the two jar-files
    mail.jar and activation.jar

    any ideas?

    Matthias
     
    Matthias Griem, Feb 7, 2008
    #5
  6. Mark Space wrote:

    > Matthias Griem wrote:
    >>>GNU Java version 4.2.1 (SUSE Linux) (i586-suse-linux)
    >>> compiled by GNU C version 4.2.1 (SUSE Linux).
    >>> GGC heuristics: --param ggc-min-expand=99 --param
    >>> ggc-min-heapsize=129464 Class path starts here:
    >>> mail.jar/ (zip)
    >>> activation.jar/ (zip)
    >>> /usr/share/java/libgcj-4.2.1.jar/ (system) (zip)
    >>> /usr/lib/gcc/i58

    >>
    >> 8< snap:

    >
    > It really does appear that there is a third .jar (at least) that is not
    > found:
    >
    > MailSender.java:(.text+0x108): undefined reference to
    > `javax::mail::Session*
    >
    >
    > So MailSender can't find javax.mail.Seseion package.


    it is for shure in 'mail.jar' - i checked it.
    And the Program works fine using javac/java or Eclipse

    so there must be something else ... gcj does not
    find/use/compile/link ???...

    thanks anyway

    Matthias
     
    Matthias Griem, Feb 7, 2008
    #6
  7. Matthias Griem

    Lew Guest

    Re: Problems compiling Java-Prog with gcj using JavaMail (mail.jar)and JAF (activation.jar)

    Matthias Griem wrote:
    > DBloke wrote:
    >
    >> Hi Matthias,
    >>
    >> Ok sorry I did notice one other thing I am not sure it is relevant but
    >> below it looks like there is a disable flag for libgjc "--disable-libgcj"
    >>
    >> not sure if this helps?
    >>
    >> Configured with: ../configure --enable-threads=posix --prefix=/usr
    >> --with-local-prefix=/usr/local --infodir=/usr/share/info
    >> --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
    >> --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
    >> --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.2.1
    >> --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib
    >> --with-system-zlib --enable-shared --enable-__cxa_atexit
    >> --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
    >> --program-suffix=-4.2 --enable-version-specific-runtime-libs
    >> --without-system-libunwind --with-cpu=generic --host=i586-suse-linux

    >
    >
    > sorry, iforgot to mention that the usual 'HelloWorld' can be compiled and
    > run successfully.
    >
    > there must be something else, probably compile/link the two jar-files
    > mail.jar and activation.jar
    >
    > any ideas?


    Yes. GCJ is lame and not compatible with Java.

    --
    Lew
     
    Lew, Feb 8, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    0
    Views:
    392
    Steve
    Jul 1, 2005
  2. Marine
    Replies:
    3
    Views:
    23,678
    Marine
    Feb 15, 2006
  3. -intl.com
    Replies:
    1
    Views:
    377
    Martin Gregorie
    Oct 22, 2006
  4. Ike
    Replies:
    4
    Views:
    1,159
    ramarao g.v.
    Mar 20, 2007
  5. R. Vince

    mail.jar & activation.jar

    R. Vince, Apr 26, 2007, in forum: Java
    Replies:
    3
    Views:
    975
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Apr 28, 2007
Loading...

Share This Page