Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot access Java from extensions in Firefox 4

5 views
Skip to first unread message

Brian Fernandes

unread,
Aug 8, 2010, 10:10:07 AM8/8/10
to
I have an extension which uses Java (http://thegoan.com/firebible) and
am having trouble porting it to Firefox 4. I'm using the technique
described here: https://developer.mozilla.org/Talk:en/Java_in_Firefox_Extensions
and it has been working just fine in Firefox 3, 3.5 and 3.6.8.

In Firefox 4 (tried b2 and b4pre), I get the dreaded "ReferenceError:
java not defined" error when executing something as simple as "var s =
java.lang.String". We can even see this outside an extension by
executing "alert(java)" in the Error Console - the above error is
logged, but strangely enough it still causes the Java Console to start
and show up in the system tray. So it is triggering Java in some way,
but the reference still fails. The Java plugin is installed, applets
are working and tests like the one here: http://www.java.com/en/download/help/testvm.xml
indicate that Java is working fine in the browser. I'm using Java 6
Update 21 on Windows 7.

I read a recent note about Java XPCOM being removed (http://
groups.google.com/group/mozilla.dev.extensions/browse_frm/thread/
e142c1f4a702b856?tvc=1&q=java+xpcom) but I know this is unrelated as
mentioned in the last post.

I'm not even at the extension level yet, as a simple "alert(java)"
fails to work. Executing the same in 3.6.8 will show you a message
dialog with a Java object, no errors logged and the extension works
fine. I noticed just one other mention of this problem:
http://twitter.com/AxelNennker/status/19717271307
Any ideas on how to proceed?

Thanks,
Brian.

Brian Fernandes

unread,
Aug 9, 2010, 11:38:13 PM8/9/10
to
0 new messages