Problem with j2sdk1.5.0 RC

I had been using a software called ImageJ (http://rsb.info.nih.gov/ij/)

with both j2sdk1.4.2 and j2sdk1.5.0 beta without any problems.

I downloaded and installed j2sdk1.5.0 RC and when I tried to

open an image I got the following messages

java.lang.NullPointerException

at sun.awt.X11.XMenuPeer.repaintMenuItem(XMenuPeer.java:360)

at

sun.awt.X11.XCheckboxMenuItemPeer.setState(XCheckboxMenuItemPeer.java:46)

at java.awt.CheckboxMenuItem.setState(CheckboxMenuItem.java:177)

at ij.Menus.updateMenus(Menus.java:817)

at ij.WindowManager.setCurrentWindow(WindowManager.java:47)

at ij.WindowManager.addImageWindow(WindowManager.java:146)

at ij.WindowManager.addWindow(WindowManager.java:136)

at ij.gui.ImageWindow.<init>(ImageWindow.java:67)

at ij.gui.ImageWindow.<init>(ImageWindow.java:45)

at ij.ImagePlus.show(ImagePlus.java:300)

at ij.ImagePlus.show(ImagePlus.java:281)

at ij.plugin.AboutBox.run(AboutBox.java:70)

at ij.IJ.runPlugIn(IJ.java:101)

at ij.Executer.runPlugIn(Executer.java:170)

at ij.Executer.runCommand(Executer.java:129)

at ij.Executer.run(Executer.java:62)

at java.lang.Thread.run(Thread.java:595)

I switched back to j2sdk1.4.2 to make ImageJ to work.

Michal

[1351 byte] By [wolalona] at [2007-9-30 18:09:13]
# 1
That's nice.
ChuckBing at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 2
I installed jdk-1.5.0-linux-i586 and got the same problem.Alvaro
alvarops at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 3
Does this error occur, if you run the JVM with the following option:"-Dawt.toolkit=sun.awt.motif.MToolkit"
sammer at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 4

I like the look of the -Dawt.toolkit=sun.awt.X11.XToolkit, which is the default look and feel for Java 5.0. I do not like the look of -Dawt.toolkit=sun.awt.motif.MToolkit, but I need my Java realy time stock quoting app at http://channel.bridge.com to work properly. Because of this I am using -Dawt.toolkit=sun.awt.motif.MToolkit so that the right mouse menu work correctly.

When will Sun fix this bug for Linux!!!!!!!!!!!!!

krmayfield at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 5
Just test again with 1.5.0_4 and this is still a bug. Does the Sun Java team look at this forum. I really wish they would fix this!!!!!!!!!
krmayfield at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 6
More likely it's a bug in your 3rd party library, possibly exploiting a non-supported feature existing only in the 1.4 API.
jwenting at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 7

I had a similar problem going to JDK1.5 my solution was a wrapper to ignore the null pointer problem, the application then seemed to work fine.

public void safeMenuSetEnabled(MenuItem mi, boolean active) {

if (mi != null) {

try {

// Solaris 10 (x86, others?) under alternate toolkit will null, but it does

// set the enable or disable of the MenuItem in the peer, silently trap and

// ignore the error under the following environment:

//setenv AWT_TOOLKIT XtoolKit

// -or-

//-Dawt.toolkit=sun.awt.X11.XToolkit

if (active) {

mi.enable();

} else {

mi.disable();

}

} catch (java.lang.NullPointerException e) {

// do nothing ...

}

}

}

I don't know if Sun ever solved this issue I think I oppend a BUG report, remember Java stands for "write once hack everywhere"

jon_strabala at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 8
It's NO bug in the JDK or JVM, but rather your addon library.Don't blame Sun for problems in the products of other companies.
jwenting at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 9
sammer,Why did you answer a question on Jun 22, 2005 11:35 PMwhich has asked at Oct 4, 2004 7:16 AM ?
jesperdj at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...
# 10
He didn't answer the question, he rather posed another question in addition to it.
jwenting at 2007-7-6 18:40:43 > top of Java-index,Administration Tools,Sun Connection...