File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes 1.5 JVM would not show NPE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "1.5 JVM would not show NPE" Watch "1.5 JVM would not show NPE" New topic

1.5 JVM would not show NPE

Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 692
Funny business debugging code today: The 1.5 JVM hung/exited my program instead of showing stack trace for a NullPointerException. There was no message at all.
I salted my program with println's and finally found where there was possibly a NPE, but the java command would not show it.
I tried the 1.4 java.exe and immediately got the NPE trace!
What is going on???
This is the first time I've seen this kind of thing. Going back several years.

Is 1.5 that unreliable on a Win98 system?

Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Can you show us the code?
Is it reproducable with a small amount of lines?
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

I've been having that exact same issue on Windows for Workgroups.

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
That's odd. I would be interested in seeing a small example that reproduces this.


Java API Documentation
The Java Tutorial
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 692
The problem is not always repeatable. After I used JVM 1.4, then 1.5 would get and display the stack trace for the NPE.
Since there are 17 source files of about 240K bytes, I haven't tried to isolate the problem because it doesn't always happen. It may be related to the mini-IDE/smart editor I'm using (WinEdit).
I think I'll go back to JVM 1.4 to finish developing this project.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Frankly, I'm rather amazed to hear that Tiger supports Windows 98. I don't think you're going to be running any C# programs on that OS!

But in any case, it sounds to me like an issue whereby error output doesn't always get flushed on process exit. If you're saying, as I think you are, that this happens when the output is going into an IDE, rather than to the command window itself -- well, again, I'm bloody amazed this works at all.

If you can't afford to upgrade to a 21st century version of Windows, you might consider Linux.

[Jess in Action][AskingGoodQuestions]
Joanne Neal

Joined: Aug 05, 2005
Posts: 3742
Originally posted by Ernest Friedman-Hill:
Frankly, I'm rather amazed to hear that Tiger supports Windows 98.

Sun release notes say that it supports Windows 98 (2nd Edition)

I agree. Here's the link:
subject: 1.5 JVM would not show NPE
It's not a secret anymore!