{"id":23,"date":"2008-02-27T19:42:55","date_gmt":"2008-02-27T23:42:55","guid":{"rendered":"http:\/\/46.19.32.152\/blog\/?p=23"},"modified":"2015-10-26T20:28:28","modified_gmt":"2015-10-27T00:28:28","slug":"icedtea-and-liveconnect","status":"publish","type":"post","link":"https:\/\/www.fitzsim.org\/blog\/?p=23","title":{"rendered":"LiveConnect support in IcedTea"},"content":{"rendered":"<p>My FOSDEM talk was on IcedTea and LiveConnect.  I&#8217;ve been working on a gcjwebplugin rewrite called IcedTeaPlugin on-and-off for the past five months.  Whereas gcjwebplugin is a Netscape 4.x plugin, IcedTeaPlugin is an XPCOM plugin that implements OJI &#8212; the Open JVM Interface &#8212; for LiveConnect support.  I showed two demos at FOSDEM, one demo for each of the two test applets I&#8217;ve used for development.  Here are the screenshots, taken just after I got each applet working:<\/p>\n<p><strong>JavaScript-to-Java direction<\/strong><br \/>\n<a href=\"https:\/\/www.fitzsim.org\/screenshots\/IcedTeaPlugin-2008-01-21.png\"><img decoding=\"async\" src=\"https:\/\/www.fitzsim.org\/screenshots\/IcedTeaPlugin-2008-01-21-thumbnail.png\" alt=\"JavaScript-to-Java direction\" \/><\/a><\/p>\n<p>The text field and setText button are HTML form widgets.  The &#8220;hello&#8221; string is passed from the text field to the Java applet on the right and displayed in bold.  You can see the code in the page source of the <a href=\"http:\/\/www.sislands.com\/coin70\/week9\/java\/example.htm\">original example<\/a>.<\/p>\n<p>Because of LiveConnect&#8217;s extensive use of Java reflection upon initialization, making <em>any<\/em> applet work, even the trivial &#8220;Hello, World&#8221; applet shown here, involves implementing <em>most<\/em> of OJI.<\/p>\n<p><strong>Java-to-JavaScript direction<\/strong><br \/>\n<a href=\"https:\/\/www.fitzsim.org\/screenshots\/IcedTeaPlugin-2008-02-16.png\"><img decoding=\"async\" src=\"https:\/\/www.fitzsim.org\/screenshots\/IcedTeaPlugin-2008-02-16-thumbnail.png\" alt=\"JavaScript-to-Java direction\" \/><\/a><\/p>\n<p>The Java applet on this page calls into JavaScript to retrieve the page&#8217;s background color, then sets its own background color to match.  Here&#8217;s the <a href=\"http:\/\/www.apl.jhu.edu\/~hall\/CWP-Sources\/CWP-Examples\/Chapter19\/MatchColor.java\">example source code<\/a>.<\/p>\n<p>I put my <a href=\"https:\/\/www.fitzsim.org\/people.redhat.com\/fitzsim\/fosdem-2008\/fosdem-2008-liveconnect.pdf\">presentation slides<\/a> online.<\/p>\n<p>I&#8217;m pleased that I was able to retain gcjwebplugin&#8217;s out-of-process-JVM design in IcedTeaPlugin, despite the fact that OJI was obviously designed with libjvm.so embedding in mind.  Basic applets work but there&#8217;s still lots to be done before IcedTeaPlugin can be declared production-ready.  It is hosted in the IcedTea 7 Mercurial repository enabled by the &#8211;enable-liveconnect configure option.<\/p>\n<p>I learned at FOSDEM that Sun is also working on a new plugin framework, in a private repository.  LiveConnect support is <a href=\"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=304021\">important<\/a> <a href=\"http:\/\/icedtea.classpath.org\/bugzilla\/show_bug.cgi?id=85\">to<\/a> Fedora plugin users, and that&#8217;s what motivates my work on IcedTeaPlugin.  If Sun&#8217;s new plugin framework were released and could be deployed in Fedora faster than IcedTeaPlugin then I&#8217;d be willing to work on it instead.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My FOSDEM talk was on IcedTea and LiveConnect. I&#8217;ve been working on a gcjwebplugin rewrite called IcedTeaPlugin on-and-off for the past five months. Whereas gcjwebplugin is a Netscape 4.x plugin, IcedTeaPlugin is an XPCOM plugin that implements OJI &#8212; the Open JVM Interface &#8212; for LiveConnect support. I showed two demos at FOSDEM, one demo &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.fitzsim.org\/blog\/?p=23\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;LiveConnect support in IcedTea&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"_links":{"self":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23"}],"version-history":[{"count":5,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":166,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/23\/revisions\/166"}],"wp:attachment":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}