This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
How to handle a NullPointerException
- From: Dimiter Stamenov <pamir at abv dot bg>
- To: java at gcc dot gnu dot org
- Date: Wed, 20 Feb 2008 14:27:17 +0200 (EET)
- Subject: How to handle a NullPointerException
Hi experts,
I have successfully compiled a Java project with gcj from Java source, but when start the compiled executable, a java.lang.NullPointerException is thrown without a stack trace.
If I could know what is the reason it, I may eventually be able to modify the source to avoid it, but how to know that? When I run the program with the standard JVM, there is no problem.
Everything I know is the class and high-level method in which it happens.
The system is Windows XP with GCJ 4.2 from http://www.thisiscool.com/gcc_mingw.htm.
The compile command is:
gcj --main=Universal -o universal.exe -g -s @files.list
The output when start the universal.exe is:
java.lang.NullPointerException
<<No stacktrace available>>
The output from gdb is:
(gdb) run
Starting program: universal.exe
Loaded symbols for D:\WINDOWS\system32\ntdll.dll
Loaded symbols for D:\WINDOWS\system32\kernel32.dll
Loaded symbols for D:\WINDOWS\system32\advapi32.dll
Loaded symbols for D:\WINDOWS\system32\rpcrt4.dll
Loaded symbols for D:\WINDOWS\system32\msvcrt.dll
Loaded symbols for D:\WINDOWS\system32\user32.dll
Loaded symbols for D:\WINDOWS\system32\gdi32.dll
Loaded symbols for D:\WINDOWS\system32\ws2_32.dll
Loaded symbols for D:\WINDOWS\system32\ws2help.dll
Program received signal SIGSEGV, Segmentation fault.
0x00823916 in ?? ()
Could you suggest me what to do?
Thanks in advance
Dimitar