The menu item |Tasks|Tools|Java Console| does not indicate the absence of the Java plug-in or JRE access.



Core Graveyard
Java: OJI
18 years ago
8 years ago


(Reporter: Curtis Clauson, Assigned: Xiaobin Lu)


Firefox Tracking Flags

(Not tracked)



(5 attachments)



18 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m18) Gecko/20001127
BuildID:    2000112720

Build ID: 2000112720
 on  Win2Kpro 5.00.2195 SP1 IE5.5,
 and WinMe    4.90.3000     IE5.5

There is no indication as to whether the Java plug-in is installed. The menu item
   |Tasks|Tools|Java Console|
is NOT disabled when the plug-in is not installed. When it is chosen, nothing

As there is no documentation or instruction available to a user, no hint that a
plug-in is needed for an Applet to access Java, and given that all browsers in
the past have installed their own JVM which gave automatic access to Java, the
user is left with no idea as to what could be wrong or what to do about it.

Two solutions are needed.
  1. All UI functions which depend on an installed component must visually
indicate that the function is unavailable if the component is absent.
  2. The release notes available from the |Help|Release Notes| menu item for
each release must contain a list of the optional components that are not
installed by default, what browser functions they affect or enable, and
instructions and/or links as to how to install them.

A better remedy:
  My preferred solution to this type of situation is to design the UI with a
proactive stance and not depend on the documentation. For menu items I define a
visual state seperate from disabled to indicate that the function would be
available but for a missing component. The visual cue I use is to display the
menu item as enabled and stricken (with the font attribute "strike-through"
which adds a horizontal line through each letter). The menu item also displays a
tooltip to indicate the missing component (An MSWindows thing, the status bar
might be used if a tooltip system is not available). If the menu item is chosen,
a dialog box comes up describing the missing component(s) and providing a link
or button to an installation instruction or process for the missing component(s).

  This allows your UI to still work clearly, independent of any missing
documentation, but it should never be seen as an excuse to lower the priority of
or not provide the related documentation. I submitted this bug after being
verbally backhanded when I misinterpreted it in a related bug report as a Java
Console failure in the presence of a working Java environment since I had no
idea, reference, or indication that a plug-in was needed or missing. I only
managed to finally confirm the true source of this problem through a third-party
FAQ via a general web search.

Reproducible: Always
Steps to Reproduce:
Close all the instances of the Mozilla browser. Remove the Java plug-in DLLs
(like npjava11.dll, npjava12.dll, and npjava3s.dll) from the installation
"plugins" directory (typically "c:\Program Files\Mozilla\Seamonkey\plugins").
Start a new browser instance. Note the state of the |Tasks|Tools|Java Console|
menu item.

Actual Results:  The menu item |Tasks|Tools|Java Console| is still normally
enabled. When you choose it, nothing happens. In the absense of any related
documentation in the release notes, the user is left with no clue as to what is

Expected Results:  At the very least, any UI function disabled by the lack of an
optionally installed component or a failed or disabled component should be
visually indicated. Optional components, their default state, and access and
installation instructions should be present in a file available from the Help
menu, such as the release notes.

Comment 1

18 years ago
*** Bug 61473 has been marked as a duplicate of this bug. ***

Comment 2

18 years ago
confirming bug.
Ever confirmed: true

Comment 3

18 years ago
As of 12/6/2000, the Mozilla 0.6 release notes now include, under the
Installation Notes section, the fact that Mozilla needs a JRE plug-in installed
before it can run Java and a link to the Sun J2 plug-in. (Yay!)

The |Tasks|Tools|Java Console| menu item still appears enabled and does nothing
when there is no installed Java plug-in. (Boo!)

But at least there is a buried clue now <grin>.

Comment 4

18 years ago
Xiaobin, I think this is an interesting bug that touches on a variety of 
layers: native code, javascript, XUL, idl.  My fix to bug 
<> can be used as a guide.  
This fix hooked up the Java console in the first place.  Your fix shouldn't be 
too different.  There will be two tricky things in this bug fix:

1. How to "grey out" an item in the mozilla ui (ask XUL people)

2. How to determine the absence of the java plugin.  You may need to add a 
method to nsIJVMManager.idl, but hopefully not.

Please ask me any questions you may have.
Assignee: edburns →

Comment 5

18 years ago
Created attachment 20940 [details]
possible fix for this bug

Comment 6

18 years ago
Hi, Ed:
   I created an attchment for this bug.I called it "possible fix" because I 
changed the nsIJVMManager.idl file. The reason is "IsJavaEnabled" method it 
provides needs to pass a reference as a parameter  in order to call. However, 
as you know javascript can not pass a reference as a parameter to call a 
fuction. I tried it many times, still can not. So I created another method 
called JavaEnabled which takes no parameter but returns a boolean value to the 
caller. Javascript calls this method and it seems it can return a correct value.
   I know your suggestion is very important for me. Thanks!

Comment 7

18 years ago
This suggests an interesting complication. Are all JREs or Java plug-ins 
required to provide a Java Console? What would happen if an installed plug-in 
to an installed JRE did NOT provide a Java Console? Would the menu item stay 
disabled, or would it be enabled and either do nothing or cause unexpected 
behavior? If the menu item stayed disabled, how would the user know if a 
working JRE plug-in was installed and correctly running? I've seen no list of 
installed components or plug-ins and their status in the UI as of yet.

Comment 8

18 years ago
  Curtis, you brought up a very interesting issue and it is a very good 
question. To answer your fisrt question:
Q:   Are all JREs or Java plug-ins required to provide a Java Console? 
A:   I am not sure they are *required*,but they do exist for all Java Plug-in 
release from Sun.
  Basically the vendor who wants to provide a Java plug-in to the clients must 
be aware that they need to implement some interfaces under 
mozilla/modules/oji/public. Among these interfaces,there are 2 methods 
called "isJavaEnabled" and "showJavaConsole". I think it is necessary for a 
good plugin provider to implement the "isJavaEnabled" method. At that time if 
Java plugin is installed and Java is enabled, the Java Console menu will not be 
greyed out. If the plug-in vendor provide the implementation of 
showJavaConsole, then click the Java Console will make you see the Java 
Console, otherwise, you will see nothing. I am not sure I have answered your 
question or not and I am very glad that you could give us some useful clue and 
suggestion. Thanks very much!

Comment 9

18 years ago
If the JRE plug-in is installed but the ShowJavaConsole() function returns an 
error (the console is not provided or there was some other problem bringing it 
up), will Mozilla at least provide an error dialog informing the user of the 
problem and/or suggested resolution?

My point is: There should be no circumstance in which a UI action is not 
successfully accomplished and no feedback is given to the user as to what 
happened or what they should do to resolve the problem. Clicking a menu item 
and simply having nothing happen would be an example of this.

Comment 10

18 years ago
  Based on Curtis's suggestion, I add an alert when the showJavaConsole returns 
an error or some exception were caught.
  Thanks a lot, Curtis!

Comment 11

18 years ago
Created attachment 21156 [details]
Add an alert when showJavaConsole has some error happens

Comment 12

18 years ago
   Would you review the fix for me? Thanks very much and happy new year!

Xiaobin Lu

Comment 13

18 years ago
Hi Xiaobin, please accept this bug.

Your fix looks good.  When my build completes, I'll test it and check it in to
the trunk.



18 years ago

Comment 14

18 years ago
Xiaobin, I have tested this on win32 RTM branch and Solaris Trunk and it 
works.  Please get sr=brendan or sr=waterson and I'll check this into the trunk.

Perhaps we can put it in the OEM branch too.


Comment 15

18 years ago
Created attachment 21899 [details] [diff] [review]
Use "oncreate" instead of "onclick", use instead of alert

Comment 16

18 years ago
   I have created a new attachment for the fix of this bug.I used "oncreate" 
instead of "onclick" and now I can see the java console becomes grey even I do 
not clcik the Task menu. I used the "" instead of alert.
  Please give me review of the fix. Thanks for your guys suggestions and help!

Comment 17

18 years ago
Created attachment 22096 [details] [diff] [review]
Same as above except expand the tab
you don't need to say 'new Boolean(false)' in js, var foo = false; is sufficient. 

other than that,

Comment 19

18 years ago
Okay, r=blake, but there's some bad indentation in there and the grammar for 
the error message isn't correct (neither is the html outputted), but I'll fix 
it assuming you don't you have a cvs account.  Do you need me to check this in?

Comment 20

18 years ago
+      doc.write("<HTML><HEAD><TITLE>Warning!</TITLE></HEAD>");
+      doc.write("<B>Some error happens with your java plugin!</B>");
please fix this to include <BODY>, </BODY> and </HTML>

also, please attach your fixed patch for review before committing. thanks.
Keywords: patch

Comment 21

18 years ago
Created attachment 22159 [details] [diff] [review]
"New" Version: Some mistakes were corrected

Comment 22

18 years ago
  Thanks for your guys' suggestions!
  I've corrected the mistakes and posted the new patch.
  I don't have cvs check in permission right now even I have applied weeks 
ago.Please feel free to correct some mistakes about the indentation and check 
in the patch.
  Thanks again!

Comment 23

18 years ago
Fix checked in, with these modifications:

* no need to try/catch for the service retrieval, and thus no need for that 
warning message (which is good, since that text wasn't localizable anyways).
* simplification of patch
* proper indentation
* change function name
* move check to Tools popup creation
* make the reference to the jvm manager service global

Thanks for the patch!
Last Resolved: 18 years ago
Resolution: --- → FIXED
timeless: fwiw, <html> and <body> are optional, the DOCTYPE (missing) is not.

Not that I have a clue what I'm talking about, but isn't this patch going to
proove difficult to localize? What with the hardcoded error message and all.

Seems like the whole bit that opens a window and stuff should be XUL not HTML.
But like I said, I'm not an expert, I'll rely on blake's obviously superior 
knowledge in this area and assume that this is ok.
oops, i'm a moron; I didn't see blake say that he'd got rid of that part of the
patch anyway! sorry! :-)

Comment 26

18 years ago
yes, i realized that and paniced yesterday. so i asked someone to design a xul 
window. i need to see what blake actually checked in.

Comment 27

18 years ago
  Hi, Blake:
     Thanks very much for your help!

Comment 28

18 years ago
checked this on windows,mac and linux trunk. Are we going to get this in the
branch as well or has this been already done ? Also ,I notice that the very
first time you open the Tools submenu(with java plugin absent), "Show Java
Console' is not greyed out. But it grays out once I click on it and then revisit
the submenu. Is that the required behaviour or would we want to disable it even
before the user clicks on it the first time ? Pls comment !

Comment 29

18 years ago
 If you applied the new patch, the java console will grey out (without java 
plugin) even when the user does not click it. For example, you click File menu 
and then use mouse to go to Task, even you don't click the Task, the java 
console will grey out. 

Comment 30

18 years ago
Yeah, I noticed this also.  Can you file a new bug on me to investigate this?  
It sounds like a problem with oncreate possibly not firing.

Comment 31

18 years ago
  Hi, Blake:
     I am not sure what you have noticed. I changed onclick to oncreate so that 
no click is to made java console become grey when java is not installed.
     I don't think there is any problem of oncreate. Am I lost here? Please 
comment. Thanks!

Comment 32

18 years ago
Am marking this verified since I have logged another bug for the new problem I
saw while verifying this bug.

Comment 33

17 years ago
*** Bug 56124 has been marked as a duplicate of this bug. ***


8 years ago
Component: Java: OJI → Java: OJI
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.