Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problems compiling Java-Prog with gcj using JavaMail (mail.jar) and JAF (activation.jar)

Reply
Thread Tools

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

 
 
Matthias Griem
Guest
Posts: n/a
 
      02-07-2008
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+0x10: undefined reference to `javax::mail::Session* javax::mail::Session::getDefaultInstance(java::uti l:roperties*, javax::mail::Authenticator*)'
MailSender.java.text+0x141): undefined reference to `void javax::mail::Session::setDebug(bool)'
MailSender.java.text+0x14: undefined reference to `javax::mail::internet::MimeMessage::class$'
MailSender.java.text+0x177): undefined reference to `javax::mail::internet::MimeMessage::MimeMessage(j avax::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::InternetA ddress(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::InternetA ddress(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::InternetA ddress(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


 
Reply With Quote
 
 
 
 
DBloke
Guest
Posts: n/a
 
      02-07-2008
Matthias Griem wrote:
Looks like a missing classpath problem from first sight, afraid I know
little about GCJ.

Hope this helps
DB
 
Reply With Quote
 
 
 
 
DBloke
Guest
Posts: n/a
 
      02-07-2008
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
 
Reply With Quote
 
Mark Space
Guest
Posts: n/a
 
      02-07-2008
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+0x10: undefined reference to
`javax::mail::Session*


So MailSender can't find javax.mail.Seseion package.
 
Reply With Quote
 
Matthias Griem
Guest
Posts: n/a
 
      02-07-2008
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
 
Reply With Quote
 
Matthias Griem
Guest
Posts: n/a
 
      02-07-2008
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+0x10: 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
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      02-08-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined reference to when using gcj vlenin66 Java 2 12-31-2007 08:18 PM
clarification needed for ecj and gcj Yao Java 1 06-19-2006 06:38 AM
GCJ and its Eclipse plugin =?iso-8859-1?B?bW9vcJk=?= Java 3 03-01-2006 06:25 PM
Compiling GCJ executables with icons? Steve Java 0 07-01-2005 04:38 PM
Problem Listing Java Source using GCJ and GDB John Java 0 04-01-2004 12:22 AM



Advertisments