<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17607</bug_id>
          
          <creation_ts>2008-02-29 08:34:08 -0800</creation_ts>
          <short_desc>&apos;java&apos; object not exposed to js</short_desc>
          <delta_ts>2010-02-23 16:03:41 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Java</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>15109</dup_id>
          
          <bug_file_loc>javascript:alert(java.lang.System.getProperty(%22java.version%22))%3B</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Michael A. Puls II">shadow2531</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>ap</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72340</commentid>
    <comment_count>0</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2008-02-29 08:34:08 -0800</bug_when>
    <thetext>(Safari 3.1.525.9)

In JS with Java installed, you should be able to get the Java version by doing:
alert(java.lang.System.getProperty(&quot;java.version&quot;));

This fails because &apos;java&apos; is not exposed to js. Works fine in Opera and FF.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72482</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-03-02 02:56:41 -0800</bug_when>
    <thetext>It&apos;s by design. You cannot call Java directly from javascript. First you should create an applet on the page. After that you can use LiveConnect to call methods from the applet using JavaScript. This *proper* method works fine in Webkit.

Check this page to read how to do it: http://www.whatscookin.com/staff/mattd/articles/jre-detection.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72488</commentid>
    <comment_count>2</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2008-03-02 05:31:10 -0800</bug_when>
    <thetext>Thanks.

I was referring to &lt; http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Packages &gt; and &lt; http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:java &gt;. For example:

&lt;script&gt;
(function() {
    var theOwner = new java.awt.Frame();
    var theWindow = new java.awt.Dialog(theOwner);
    theWindow.setSize(350, 200);
    theWindow.setTitle(&quot;Hello from Opera and Firefox&quot;);
    theWindow.setVisible(true);
    theWindow.show(true);
    setTimeout(function() {
        theWindow.dispose();
    }, 5000);
})();
&lt;/script&gt;

(In reply to comment #1)
&gt; It&apos;s by design.

O.K., this is invalid then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193165</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-02-23 16:03:41 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 15109 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>