Java Plug-in / JSObject support with IE and Firefox

Hi there,
Basicaly, the idea behind is to write objects in Java to replace or extend functionnalities of a web page (like XMLHttpRequest object). Those objects should support event handler writen in Javascript.
My first idea was to create JavaBeans and instantiate them through OBJECT tags in HTML (not as ActiveX objects). I don't find a way to instatiate a Javabean which was not also an applet.
Does someone knows how to ?
Anyway, the OBJECT tag may not work with Netscape. So, I went to use the APPLET tag with the Sun Java Plug-in.
I've made some tests with IE and Firefox and there is at least two differences between them (both use the Sun Java Plug-in) :
1/ Firefox / JSObject
When you pass a Javascript object to a Java method, it seems that you
cannot use methods like 'getMember', 'call', etc on this object.
(invocation of the method works but returns null)
But, if you access the same object form inside Java starting by
JSObject.getWindows(...) and so on, it works fine.
IE works in all cases.
Example, with the Java applet and HTML below :
. Java applet :
| package JavaJS;
|
| import netscape.javascript.*;
|
| public class FirefoxApplet
|        extends java.applet.Applet {
|   netscape.javascript.JSObject win = null;
|  
|   public void init() {
|     win = netscape.javascript.JSObject.getWindow(this);
|   }
|
|   public Object getJSObjectMember( netscape.javascript.JSObject jso, String member ) {
|     return jso.getMember(member);
|   }
|
|   public netscape.javascript.JSObject getJSObjectFromPath( String jsoPath ) {
|     String [] jsoNames = jsoPath.split("\\.");
|     netscape.javascript.JSObject jso = win;
|
|     for( int i = 0; ( i < jsoNames.length ); i++ )
|       jso = (netscape.javascript.JSObject)jso.getMember(jsoNames);
|
| return jso;
| }
|
| public Object getJSObjectPathMember( String jsoPath, String member ) {
| return getJSObjectMember(getJSObjectFromPath(jsoPath),member);
| }
| }
[i]. HTML page :| <HTML>
| <HEAD>
| <TITLE>FirefoxApplet</TITLE>
| <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
| <META http-equiv="Content-Script-Type" content="text/javascript">
| <SCRIPT>
| var ffxa = null;
| var txa = null;
|
| var o = {
| s : "object o, member s",
| o : {
| s : "object o.o, member s"
| }
| }
|
| function go() {
| print(ffxa.getJSObjectMember(o,"s"));
| print(ffxa.getJSObjectMember(o.o,"s"));
| print(ffxa.getJSObjectPathMember("o","s"));
| print(ffxa.getJSObjectPathMember("o.o","s"));
| print(ffxa.getJSObjectMember(ffxa.getJSObjectFromPath("o"),"s"));
| print(ffxa.getJSObjectMember(ffxa.getJSObjectFromPath("o.o"),"s"));
| }
|
| function print( text ) {
| txa.value = txa.value+text+"\n";
| }
|
| function loaded() {
| ffxa = document.getElementById("ffxa");
| txa = document.getElementById("txa");
|
| }
| </SCRIPT>
| </HEAD>
| <BODY onload="loaded()">
| <APPLET id="ffxa"
| code="JavaJS.FirefoxApplet.class"
| width="0"
| height="0"
| MAYSCRIPT>
| </APPLET><BR>
| <INPUT type="button" onclick="go()" value="Go"><BR>
| <TEXTAREA id="txa" rows="10" cols="40"></TEXTAREA>
| </BODY>
| </HTML>
When the HTML page has loaded, a click on the Go button gives :
. Firefox output :
| null
| null
| object o, member s
| object o.o, member s
| null
| null
. IE output :
| object o, member s
| object o.o, member s
| object o, member s
| object o.o, member s
| object o, member s
| object o.o, member s
2/ Internet Explorer / JSObject
As we have seen in the previous example, passing Javascript object to
an applet method works. Here, the problem comes when a Javascript object
is pass to a method that's not an applet's method.
If within the applet, you instantiate a new Java object and then
call from Javascript a method on this object with a Javascript object as
parameter then an Exception is raised when invoking that method.
Firefox works fine here.
Example, with the Java applet and HTML page below :
. Java applet :
| package JavaJS;
|
| public class IEApplet extends java.applet.Applet {
|  
|   public void init() {
|   }
|  
|   public Object echo( Object object ) {
|     return object;
|   }
|  
|   public Object newEcho() {
|     return new Echo();
|   }
| }
. Java Echo class
| package JavaJS;
|
| public class Echo {
|  
|   public Echo() {
|   }
|
|   public Object echo(Object object) {
|     return object;
|   }
| }
. HTML page :
| <HTML>
|   <HEAD>
|     <TITLE>IEApplet</TITLE>
|     <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|     <META http-equiv="Content-Script-Type" content="text/javascript">
|     <SCRIPT>
|       var iea = null;
|       var txa = null;
|
|       var o = {
|         s : "object o, member s",
|         o : {
|           s : "object o.o, member s"
|         }
|       }
|
|       function go() {
|         print(iea.echo(o));
|         print(iea.newEcho().echo(o));
|       }
|      
|       function print( text ) {
|         txa.value = txa.value+text+"\n";
|       }
|
|       function loaded() {
|         iea = document.getElementById("iea");
|         txa = document.getElementById("txa");
|        
|       }
|     </SCRIPT>
|   </HEAD>
|   <BODY onload="loaded()">
|     <APPLET id="iea"
|             code="JavaJS.IEApplet.class"
|             width="0"
|             height="0"
|             MAYSCRIPT>
|     </APPLET><BR>
|     <INPUT type="button" onclick="go()" value="Go"><BR>
|     <TEXTAREA id="txa" rows="10" cols="40"></TEXTAREA>
|   </BODY>
| </HTML>When the HTML page has loaded, a click on the Go button gives :
. Firefox output :
| [object Object]
| [object Object]
. IE output :
| [object Object]
with this Exception on the second method invocation :
| java.lang.ClassCastException
|      at sun.plugin.com.DispatchImpl.convertParams(Unknown Source)
|      at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
|      at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
|      at java.security.AccessController.doPrivileged(Native Method)
|      at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
| java.lang.Exception: java.lang.ClassCastException
|      at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
|      at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
|      at java.security.AccessController.doPrivileged(Native Method)
|      at sun.plugin.com.DispatchImpl.invoke(Unknown Source)There is a workaround for this, it's possible to wrap the Javascript object
in a Java object with an applet method and then use this Java object as
parameter.
Anyway, my questions are : regarding points 1/ and 2/ are these bugs with the Sun Java Plug-in ? or someone could explain these behaviors ?
Thanks for your reading.
Software infos :
. Firefox version 1.0.7
. Internet Explorer version 6.0.2800.1106 / JScript version 5.6
. Plug-in Java(TM): Version 1.4.2_08
. JSDK version 1.4.2_08
. Windows 2000 Server version 5.00.2195 sp4

Please test with the new Java Plug-In available in 6u10 at http://jdk6.dev.java.net/6u10ea.html. The Java/JavaScript bridge has been completely rewritten and is now more complete and portable than ever before. Longstanding issues should be fixed with this new version. Please try it and post if you continue to have problems.

Similar Messages

  • Problems with Safari and Firefox (HTTP?)

    Problems with Safari and Firefox (HTTP?)
    On a laptop G4, 10.5.8 and Safari 5.02 I experience the following:
    On the account of my oldest daughter everything works fine, i.e. wireless internet works and no problems with mail or safari.
    On the same laptop, on the account of my other daughter, the wireless is OK, she can mail etc. But safari nor firefox works. It says: can’t find server (whatever site) and in the activity window it looks if safari tries to open files (in the safari preferences-folder) in stead of http. Same applies to Firefox, so maybe it has more to do with HTTP in general?
    What goes wrong? What to do? I tried the following on the host terminal (tips from Apple)
    defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
    and
    defaults delete com.apple.safari WebKitDNSPrefetchingEnabled
    but that did not help,
    Nanne

    I'm still wondering why it happens now at this moment in time...
    PC does seem to be a bit odd & inconsistent, the few times I've tested with it, at least so far as we content filtering goes; and if I remember rightly, you're not the first to report previously ok settings suddenly preventing some or all internet until pc is switched off altogether.
    It may work when re-enabled

  • SSL certificate not valid in Safari, but webservice  works with Chrome and Firefox

    As a MD, I'm used to check blood results online on the service
    https://inet.zentral-labor.ch/c16/kunweb.dll - this is the online-portal of my laboratory medica in Zurich. http://www.medica.ch
    Access to the loginscreen is public ;-) and should look like this (Screenshot from Firefox)
    I've setup a new workstation 3 weeks ago (iMac with OS Lion 10.7.4), and this webservice service works fine till yesterday. Now, Safari is every time we try to reach the service telling us, that this service needs a certificate, we can choose only a default apple certificate
    and then, the error is:
    This Site needs a valid SSL-Client-Certificate... (Screenshot below)
    What's wrong with Safari? With Chrome and Firefox, the webservice works fie without any problems.
    Thanks for an advice
    MD Patric Eberle

    As a MD, I'm used to check blood results online on the service
    https://inet.zentral-labor.ch/c16/kunweb.dll - this is the online-portal of my laboratory medica in Zurich. http://www.medica.ch
    Access to the loginscreen is public ;-) and should look like this (Screenshot from Firefox)
    I've setup a new workstation 3 weeks ago (iMac with OS Lion 10.7.4), and this webservice service works fine till yesterday. Now, Safari is every time we try to reach the service telling us, that this service needs a certificate, we can choose only a default apple certificate
    and then, the error is:
    This Site needs a valid SSL-Client-Certificate... (Screenshot below)
    What's wrong with Safari? With Chrome and Firefox, the webservice works fie without any problems.
    Thanks for an advice
    MD Patric Eberle

  • Cant play YouTube with IE7. Plays fine with Chrome and Firefox.

    I embedded a YouTube video into a page www.confession-reconciliation.net but cant play it with IE7 but can play it with Chrome and FireFox.  Must be something with Flash.  Please help'
    Joe Damore

    Hi yes.  I shot a video with my camcorder on Thanksgiving Day but I  had to
    convert it to .avi and then to .flv and then embed it. It plays. Its in 
    www.joedamore.com/links.html (http://www.joedamore.com/links.html) .  This
    YouTube is strictly HTML and no .swf or .flv.
    Joe
    In a message dated 6/22/2010 9:23:58 P.M. Eastern Daylight Time, 
    [email protected] writes:
    Can you  view any other embedded videos with  IE?

  • Java Plug-in not working with WinXP SP2 Registry Key Missing Error Pop-Up

    I have WinXp PRO with SP2 and the Oct 12 Security Update Patch for SP2 loaded and I went to my Control Panel and saw that the JavaRuntime Environment 1.4.2_04 icon was missing and when I went to click the Java Plugin icon to Open it, I got the following message in a Error Pop-Up window:
    The system cannot find the registry key specified:
    HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java pPlug-in\1.4.2_04\JavaHome
    I then went to Chage Access Program Controls and when I clicked on the Change box for the program, it wanted me to re-install the whole environment.
    Prior to doing this, and potentially screwing up my MS winXp environment, I went to the Sun support page for Java Plug-in and I did get the dancing elmo appear as they said I would but I noticed that my environment was MS VM, not Java and that I was out of date and a newer update was avaliable.
    The downloads page for the plug-in states clearly that it supports WinXp SP1 and NOT SP2.
    SO, my question is, do I need to re-install anything or wait till the whole SP2 issue and java with (BITS) issue gets resolved and just use the MS VM engine during my browsing time? Is there a workaround and what impact will this have on my system? I am not developing Java Apps but am a Power user in Windows who is wondering if applets and general browsing might be easier, faster and more fluid if the Java Runtime was enabled as opposed to the MS VM solution?
    Any ideas or thoughts on this very timely issue would be greatly appreciated as I see others have tried to post related issues but none that succinctly combines what I have asked for here in this post.
    Thanks from NYC -Phil

    did you know that XP SP2 has so many technical problems? try SP1 or contact the WindowsXP Vendor

  • How to configure Java Plug-In in Mozilla 1.4 and Netscape 7 on Red Hat 9?

    How to configure the java plug-in (Java 2 v1.4.2) to work on Mozilla 1.4 and Netscape 7 on Red Hat 9?
    Thanks in advance.

    I have redhat 9 and mozilla 1.2. Installed java sdk 1.4.2 which comes with JRE 1.4.2. Had no problems/errors while installing. The about plugin page doesnot indicate that the plugin is installed. and i get the pop-up saying application/x-java-vm is not available while browsing. Any help here please ??
    Thanks

  • SilverLight and HTML support with Localization and RTL with SAP Crystal Rep

    Hi ,
    Can you please provide the fallowing information ,
    1)     Silverlight:-
    a)     Does SAP Crystal Reports support , building reports with Silverlight?
    b)     Does SAP Crystal Reports has   Silverlight Designer and Viewer support the fallowing list of languages:-
    Arabic
    Czech
    Danish
    Dutch
    English
    Estonian
    Finish
    French
    German
    Greek
    Hungarian
    Italian
    Latvian
    Norwegian
    Polish
    Portuguese
    Rumanian
    Russian
    Spanish
    Swedish
    Turkish
    Ukraine
    China
    c)     Does this support RTL format ?
    2)     HTML:-
    a)     Is there any support of Designer and Viewer to create HTML reports?
    b)     If there is a support of creating HTML reports , is there any support for above listed languages?
    c)     How about RTL support in case of that?.
    Thanks,
    Prasanna

    Hi ,
    Thanks for providing the information , need more infomation towards creating HTML reports. I didnt understand the fallowing answer
    Is there any support of Designer and Viewer to create HTML reports?
    - Yes. Export to HTML 3.2 and 4
    What i mean about support of Designer and Viewer to create HTML reports is , using SAP crystal reports tools , i must be able to design a HTML report and use the report in WebPages .
    I mostly think this can be achieved and supported , however i need some kind of acknowledgement at this point of time.
    **Also my concentartion is more on getting information on Supporting Localization for the listed languages.If you suggest some blog or forum link which demonstrates on Localization , i would appreciate , if you add infortmation on that  like , lif the approach you are suggesting is generic to accept any type of language with RTL(Right To Left format) support**
    Thanks.

  • Problem with web.show_document with Jinitiator and Firefox

    Not sure Firefox 2.0 is officially certified with Forms 9.0.4.1 and Jinitiatorbut regardless we have some users who want to use this combination. Everything seems to work fine except for the calls to web.show_document which opens a new browser window and displays some html etc.
    The problem is that even though the client Forms JVM is Jinitiator (1.3.1.18 or .21) when the call to web.show_document occurs somehow the Sun Java Plugin starts and having the two JVM's at once causes a fatal crash in Firefox. Can anyone suggest a way to preven the second JVM from opening?
    When the user uses the Sun Plug as the client Forms JVM there is no problem as the second JVM does not open. Unfortunately some users insist on Jinitiator with Firefox hence the problem. -quinn

    James,
    This whole applet embedded in a browser model for webforms is driving us batty at times. The list of problems includes:
    1) Users are constantly tempted by browser controls and accidentally do all sorts of things to get them in trouble. This has included but not limited to using the navigation arrows, jumping off to read their email in the same window as the form and returning to a dead forms session, minimizing, resizing, blurring off to another window and then returning back by clicking on the title bar of the browser and wondering why the form doesn't tab etc.
    Sure hobbling the browser by opening with limited functionality is a possibility but not a complete solution.
    2) New versions of browsers seem to break something. Both IE 7 and Firefox 2 have their own problems with web.show_document, especially file associations such as CSV and DBF and trying to open things in Excel in IE7.Firefox seems to have less problems for some yet some some oddities like the one that started this thread (and 2.0 opening new windows in tabs by default instead of windows).
    3) JVM jigsaw puzzle. Is it Jinit or Sun, which versions? Which combinations of browser version and JVM works.
    4) General fragility of the whole architecture. Running a client JVM in a web browser on top of a PC Operating system connectiong to a forms server over a network embedded in a Java Container server on a full blown web server running on a unix operating system is pushing the bubble. Throw in the mix that any of these components can be combined in numerous ways makes one wonder how it works as well as it does.
    Still users randomly getting dropped connections to forms server (network gltches?). General sluggishness (poorly written forms?). Periods of users with unduplicatable errors primarily network related it would appear.
    General feel that it is not rock solid stable. Perusing metalink documents on performance and tuning gives too much and too general info to troubleshoot so just shrug shoulders and say 'network problem'.
    What's the solution? Java webstart would seem to help at least with the browser realted issues but is that supported and documented how to use yet. Also we'd lose web_show_document which is critical (could it be replaced by webutil calls to open browser?).
    -quinn

  • Problem with CS2 and firefox 3.6x

    i have a strange problem arising from a combination of photoshop cs2 and firefox 3.6x browser in XP sp3
    when photoshop is minimised to the taskbar and then firefox is minimised, the focus of firefox seems to be passed to photoshop unexpectedly, turning its button dark blue and making it very difficult to maximise photoshop (repeated clicking and swapping of apps sometimes frees it)
    has anyone else every experienced anything like this with 3.6?
    i have installed 3.5.10 atm which works with no problem at all and holds its own focus when minimised.
    Steve

    None of those ideas worked. I used the Disk Utility and it indicated that all permissions were OK. I cleared the caches and cookies on Safari and FireFox, and even re-installed FireFox and deleted all of the old files associated with it. Both browsers brought up the Apple support website using the IP address, but neither browser would allow me to log into Apple support to follow this thread. I turned off the Firewall thinking it was the problem. I am running the PC and iMac through a router, then a dsl modem. Could any of those items be the problem?

  • When I use Firefox and Hotmail at startup, Firefox freezes for about 1 minute, and then I can continue. First I though it was my computer but 2 other girls in my class have the same problem with Hotmail and Firefox. What can I do to change this?

    When I start Firefox, about 15 seconds after I start it, my Firefox freezes for about 1 minute. I found out that it is my Hotmail that makes Firefox freeze.
    First I thought it was my computer, but I have 2 other girls in my class that use Hotmail and Firefox and their computer also freezes for 1 full minute.
    This is very annoying, what can I do to change this?
    xxx ellen
    p.s. I am from the Netherlands, maybe that has something to do with it?

    Try deleting cookies and cache:
    1. Tools| Clear recent history
    2. Time range to clear: Everything
    3. If it isn't already selected, select '''Cookies''' and '''Cache'''
    4. '''Clear now'''
    '''Check cookie exceptions'''
    1. Tools | Options | Privacy Panel
    2. Set '''Firefox will: Use custom settings for history.''' '''Insure Accept cookies for sites and accept third-party cookies''' is selected
    3. Click '''Exceptions'''. If the misbehaving site is in that list, select it and click '''Remove site'''
    '''Safe Mode'''
    Add-ons can cause problems with not being able to log into certain websites. To see if this is the case with your issue, run [[Safe mode]]. When you get to the safe mode window, select Continue in Safe Mode. If this resolves your problem, see [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    Also see [[Updating Firefox]] and [[Cannot log in to websites]]

  • Problem with ORARRP and Firefox

    We installed ORARRP utility on a pc. If we create an .rrpt file and double click it the orarrp
    utility captures the request and pops up a dialogue box. So the orarrp utility
    is successfully installed in the system.
    If we use Internet Explorer to run an .rrpt report (through an oracle forms application) the orarrp utility captures
    the request. So with IE is working fine.
    If we use firefox to run an .rrpt report (through an oracle forms application) the orarrp utility is not called
    and firefox just presents the .rrpt file on the screen.
    This issue is met in all platforms, all oracle versions, all firefox versions.
    It is very important to make it run with firefox since due to another issue some of our clients are
    forced to use firefox instead of IE.

    My solution is patching iWeb to ignore shadows with Firefox 5.0 (without warranties - you should test it )
    a) locate iWebImage.js in iWeb (usally in /Applications/iWeb.app/Contents/Resources/Scripts/Site) - with finder you must use "show package content"
    b) open this file and locate funtion "applyToElement: function(shadowed)
    c) skip shadowing with userAgent Firefox/5.0 (see if-Statement)
    d) republish the website
        applyToElement: function(shadowed)
            var framePos = new IWPoint(shadowed.offsetLeft, shadowed.offsetTop);
            var frameSize = new IWSize(shadowed.offsetWidth, shadowed.offsetHeight);
            var opacity = 1.0;
            if((navigator.userAgent.indexOf("Firefox/5.0") <= -1) && (shadowed != null))
                shadowed = $(shadowed);
                opacity = shadowed.getStyle('opacity');
                if(windowsInternetExplorer)
                    // To make an object with shadow from a given object (shadowed) we go through the following

  • Constant & erratic "Page Load Error" with Safari and Firefox

    A week or two ago, I started getting constant "Page Load Errors" ('this page cannot be found', etc) when browsing with either Safari or Firefox. These are not dead sites that time out, but are very live (and cannot be summoned no matter how many times refresh)!
    Something is wrong on my computer's end: I have strong wireless, have tried connecting with ethernet, and have used a different network. All of these produce the same result, where about half of the sites I try to connect to are instantly declared as dead by any browser I use.
    I am not using any firewall, and have emptied both browser's caches.
    Any ideas would be greatly appreciated.
    Thanks!
    Cliff

    I'm having the same problem. It only happens at home over my DSL connection. Here is what I have tried and the results.
    This really started bothering me since I upgraded to a recent Macbook Pro. I tried my original MBP with Leopard and found it doing the same thing. I ended up testing from my G4 and it works fine. The problem occurs over wireless and wired. I tried changing my MTU size with no change. I thought it was DNS but changed to other DNS and it didn't make a difference. Happens in Safari and Firefox. I am thinking it has an effect on iTune store also. The problem goes away when I VPN in to work, comes back when I close the VPN.
    Just tonight I installed an clean 10.5 Leopard on my original MBP. Safari works perfectly. Instead of updating to 10.5.6, I download the 10.5.5 update. After updating the problem reappeared.
    Again, my G4 with latest Tiger update work fine and both Macbook Pros with the latest Leopard have a problem over my DLS connection. They work perfectly fine at work and other locations.
    Ted

  • Flash has suddenly stopped working with Safari and Firefox.

    I have a Wordpress blog. Suddenly, Flash has stopped working on Safari and Firefox in relation to my Wordpress module. But everything works fine from my PC laptop and other MACs owned by friends, etc. It is only on my iMac that Flash has stopped working. Any ideas?

    Please read this post then provide some details.  What printer model? What operating system? Do you have a 32 bit or 64 bit version?
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Newbie help with 12i and firefox java issue

    We are in the testing stages for a 12i upgrade. I’m currently testing browser and java version compatibility using an upgraded test system. My problem is the version of java on the desktop client. IE7 will launch the apps fine with any version of java. However, any version of Firefox (including just released v3) will not launch java unless java version 5 update 13 is loaded. I’ve reviewed several metalink docs including 389422.1 and 393931.1 and have used the workaround listed forcing FF to use the older version of java. However, that means that we will have to roll out this older version of java to all clients to use Firefox. During my research I found where Oracle provides a techstack update for 11i (290807.1) that will fix this issue and allow Firefox to work with newer versions of java. Has anyone else run into this issue and if so how did you address it? Is there a 12i update that will fix this issue? I’m a newbie that’s started supporting Oracle, etc. so forgive me for any ignorance I show on the subject. Thanks in advance.

    Tod,
    It sounds like your Oracle E-Business Suite Release 12 instance is configured to request end-users to use JRE 1.5.0_13.
    Firefox has a known limitation (or feature, depending on your point of view): it will invoke only the specified JRE version requested by the E-Business Suite, even if later versions of the JRE (e.g. 1.6.0_03) are installed on the same desktop.
    This behaviour is explained in more detail in Note 290807.1 in Appendix A. Since this behaviour is hardcoded into Firefox, your options are:
    1. Configure your Oracle E-Business Suite Release 12 environment to request a later version of JRE installed on your Firefox-equipped desktops
    2. Use IE -- it doesn't enforce static versioning.
    3. Contact the Mozilla team and request that they provide a new option to use either static versioning (the status quo) or the latest JRE version installed on the desktop.
    Regards,
    Steven

  • JVM Java heap space Error || even with -Xms- and -Xmx commands

    hi all, i got a problem by allocating a very great boolean array.
    first of all, here is my testcode:
    public static void main(String[] args) {
              boolean[] testfield = new boolean[70000000];          
              while(true){
              //NOP     
         }as you see, i try to allocate an array with 70.000.000 boolean values - as 1 boolean may be represented as at least one physical bit we calculate the total amount of needed RAM-Space:
    70.000.000 bit / 8 = 8750000 byte
    8.750.000 byte = 8.75 MByte
    My System ist WinVista Ultimate 64-bit running on a Quadcore T2200 with 2GB-DDR3 RAM
    Looking in my Vista Ressourcemanager shows, that eclipse.exe reserves about 1.023 Mbyte....
    As IDE I use eclipse
    my eclipse.ini looks as follows:
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256M
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms512m
    -Xmx1024m
    -XX:PermSize=512mby using following VMCommand "-XX:+PrintGCDetails" and running the above code the output displays:
    [GC [DefNew: 180K->63K(960K), 0.0008311 secs][Tenured: 43K->107K(4096K), 0.0060371 secs] 180K->107K(5056K), 0.0069249 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
    [Full GC [Tenured: 107K->105K(60544K), 0.0044835 secs] 107K->105K(61504K), [Perm : 17K->16K(12288K)], 0.0045553 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
         at termain.main(termain.java:15)
    Heap
    def new generation   total 4544K, used 163K [0x246a0000, 0x24b80000, 0x24b80000)
      eden space 4096K,   4% used [0x246a0000, 0x246c8fe0, 0x24aa0000)
      from space 448K,   0% used [0x24aa0000, 0x24aa0000, 0x24b10000)
      to   space 448K,   0% used [0x24b10000, 0x24b10000, 0x24b80000)
    tenured generation   total 60544K, used 105K [0x24b80000, 0x286a0000, 0x286a0000)
       the space 60544K,   0% used [0x24b80000, 0x24b9a420, 0x24b9a600, 0x286a0000)
    compacting perm gen  total 12288K, used 16K [0x286a0000, 0x292a0000, 0x2c6a0000)
       the space 12288K,   0% used [0x286a0000, 0x286a41c0, 0x286a4200, 0x292a0000)
        ro space 8192K,  62% used [0x2c6a0000, 0x2cba2ba0, 0x2cba2c00, 0x2cea0000)
        rw space 12288K,  52% used [0x2cea0000, 0x2d4e88e0, 0x2d4e8a00, 0x2daa0000)so can anyone tell me please, how i manage to allocate bigger arrays? or where at least is the problem?
    Originally i was thinking like that way: Integer.MAXVALUE = (2^32)-1
    => biggest index an array can have
    => biggest allocation possible with ints weights (((2^32)-^1)/8)/1000*1000 = (round) 537 MByte < 2GByte => everything fine .... but it seems like not :-(
    When i try to allocate 60.0000.000 it works fine....but that is far not enough :-&
    thank you very much for your helping answers!

    The Sun Java virtual machine stores booleans as bytes, not bits, so for an array of 70 million booleans you need 70 million bytes, plus 8 bytes for the object header, and 4 bytes for the array length.
    I suspect that your eclipse.ini controls the JVM running the Eclipse IDE, not the JVM running your application. Note that in the -XX:+PrintGCDetails output at the end, it shows you running out of memory with 4MB of young generation and 60MB of old generation. That's the default configuration, as if you hadn't specified -Xms and -Xmx.
    The array of 60 million booleans only requires 60 million bytes (plus overhead), which fits in the default old generation.
    I think you need to put the -Xms and -Xmx in the same place you put the -XX:+PrintGCDetails, since that does seem to display information about the JVM running your application, not the JVM running Eclipse.

Maybe you are looking for