This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Bug gcj with date manipulations?
- To: java at gcc dot gnu dot org
- Subject: Bug gcj with date manipulations?
- From: Maurice DIAMANTINI <diam at ensta dot fr>
- Date: Thu, 1 Mar 2001 17:10:35 +0100
- Cc: Maurice DIAMANTINI <diam at ensta dot fr>
Bonjour à tous !
I'm a new gcj user and I try a program which
does work with javac/java but rise an error
with gcj.
My first impression is very hopefull, and I hope
to use java(gcj) instead of c++.
My gcl version come from cvs about a month ago (not sure)
and I'm trying to do some test to compare C and GCJ
and the feature suported by gcl relatively to javac (jdk)
> gcj --version
2.97
(should'nt be a more verbose option like --version2
giving compil date and anything usefull for
version identification?)
My plateform is linuxppc on powermac blue G3 ( 2.2.17rms1)
(and I hope MacOS-X as soon as possible with X11 and full
gcc :-)
------------------------------------------------------------
I rise an error with date format in the following :
Hier is the code :
import java.util.*;
import java.text.SimpleDateFormat;
public class Test {
public static void main(String[] args) {
// on déclare des formateurs de date et de temps :
SimpleDateFormat df =
new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSSS");
SimpleDateFormat tf =
new SimpleDateFormat( "mm'mn' ss.SSS's'");
Date startDate = new Date();
System.out.println ("Début à : " + df.format(startDate) );
Date endDate = new Date();
System.out.println ("Fini à : " + endDate);
Date duree = new Date(endDate.getTime() - startDate.getTime());
// System.out.println ("durée : " + duree/1000 +
// "." + duree%1000 + "s");
System.out.println ("durée : " + tf.format(duree));
return;
} // main
}
------------------------------------------------------------
Standard sdk compilation :
> javac Test.java && java Test
Début à : 2001-03-01 16:11:18.0653
Fini à : Thu Mar 01 16:11:18 CET 2001
durée : 00mn 00.006s
------------------------------------------------------------
gcc compilation :
> gcj --main=Test Test.java && ./a.out
Exception in thread "main" java.lang.NullPointerException
at 0x0fd46278: java::lang::Throwable::Throwable() (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fd31a48: java::lang::Exception::Exception() (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fd382f8: java::lang::RuntimeException::RuntimeException() (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fd37748: java::lang::NullPointerException::NullPointerException() (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fcf9768: _Jv_ThrowNullPointerException (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fe21bdc: java::text::DateFormatSymbols::formatsForKey(java::util::ResourceBundle*, java::lang::String*) (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fe218ec: java::text::DateFormatSymbols::DateFormatSymbols(java::util::Locale*) (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fe309ec: java::text::SimpleDateFormat::SimpleDateFormat(java::lang::String*, java::util::Locale*) (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fe30904: java::text::SimpleDateFormat::SimpleDateFormat(java::lang::String*) (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x10004298: Test::main(JArray<java::lang::String*>*) (/home/diam/projets/jorlab/benchs_java/bbbinomial_java/Test.java:9)
at 0x0fd110c8: gnu::gcj::runtime::FirstThread::run() (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fd1fd0c: java::lang::Thread::run_(java::lang::Object*) (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fec6e08: _Jv_ThreadSetPriority(_Jv_Thread_t*, int) (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcj.so.1)
at 0x0fa6f8cc: GC_start_routine (/usr/local/pack/gcc-2.97-cvs/powerpc-linux/lib/libgcjgc.so.1)
at 0x0fa33adc: pthread_detach (/lib/libpthread.so.0)
at 0x0f96d9fc: __clone (/lib/libc.so.6)
------------------------------------------------------------
--
Maurice.Diamantini@ensta.fr - ENSTA/LMA
École Nationale Supérieure de Techniques Avancées
Laboratoire de Mathématiques Appliquées
http://www.ensta.fr/~diam