JavaFXPluginDeploymentSpecification

JavaFX Plugin Deployment Specification

Document Status Initial Draft
{{{1}}}

Contents


Introduction

This document describes new Java SE 6 Update 10 deployment features applicable to JavaFX Script Plugin for Netbeans.

Related Documents

Applet

Checked with the latest JavaFX SDK.

The Java Deployment Toolkit makes deploying Java applets or Java Web Start programs a snap. The Deployment Toolkit JavaScript file provides:

  • Accurate detection of installed JREs
  • Seamless JRE installation
  • Complete applet launching (JRE detection and, if necessary, upgrading) in a single line of code
  • Complete Web Start program launching in a single line of code

The following HTML code is all it takes to ensure that Java 1.6 is installed and then a Java applet is launched:

<script src="http://java.com/js/deployJava.js"></script><br>
    
<script>
  var attributes =
      {
          codebase:'http://www.example.com/applets/',
          code: 'javafx.gui.Applet',
          width:320,
          height:400,
          archive:'lib/javafxgui.jar, lib/javafxrt.jar, lib/javafxc.jar, ExampleFXApplet.jar'
      };
   var parameters = {
          ApplicationClass: "MainFX.class"
      }
  deployJava.runApplet(attributes, parameters,"1.6");
</script>

More documentation about the deployment toolkit can be found here.

JNLP Support

Partially checked with the latest JavaFX SDK.

The next-generation Java Plug-In technology (hereafter the "Java Plug-In") provides support for launching applets directly from JNLP files. Previously, only Java Web Start utilized JNLP files, for the purpose of launching Java applications. Now Java applets can be described using the same meta-descriptor.

Usage

To launch an applet from a JNLP file, use the
jnlp_href
parameter in the {<applet>} tag:
Working only in Firefox 3 and Internet Explorer with Java 6 Update 10 Plug-In installed
<applet width="300" height="300">
      <param name="jnlp_href" value="my_applet.jnlp"/>
      <param name="draggable" value="true"/> 
</applet>
To enable an individual applet to be dragged out of the web browser, add the following parameter to your
<applet>
tag:
    <param name="draggable" value="true"> 
In this example,
my_applet.jnlp
is the JNLP descriptor for the applet. Its contents might look like this:
<?xml version="1.0" encoding="UTF-8"?>
   <jnlp href="my_applet.jnlp">
     <information>
       <title>My Applet</title>
       <vendor>My Company, Inc.</vendor>
       <offline-allowed />
       <shortcut online="false">
           <desktop/>
           <menu submenu="My Corporation Apps"/>
       </shortcut>
     </information>
     <resources>
       <j2se version="1.5+"
             href="http://java.sun.com/products/autodl/j2se" />
       <jar href="my_FXapplet.jar"/>
       <jar href="lib/javafxrt.jar"/>
       <jar href="lib/javafxgui.jar" main="true"/>
     </resources>
     <applet-desc 
         name="My Applet"
         main-class="javafx.gui.Applet"
         width="300"
         height="300">
         <param name="ApplicationClass" value="my.main.FXclass">
     </applet-desc>
   </jnlp>
  • shortcut element: The optional shortcut element can be used to indicate an application's preferences for desktop integration. The shortcut element and its sub-elements provide hints that the JNLP Client may or may not use. The shortcut element can contain the optional online attribute, and the two optional sub-elements desktop and menu.
  • online attribute: The optional online attribute can be used in a shortcut element to describe the application's preference for creating a shortcut to run the application online or offline. If the value is "true" the application prefers to create a shortcut that will launch the application online. If the value is "false" the application prefers to create a shortcut that will launch the application offline.
  • desktop element: The optional desktop element can be used to indicate an application's preference for putting a shortcut on the users desktop.
  • menu element: The optional menu element can be used to indicate an application's preference for putting a menu item in the users start menus. The menu element can have a sub-menu attribute.
  • submenu attribute: The optional submenu attribute can be used to indicate an application's preference for where to place the menu item, and can contain any string value.

Complete list of jnlp elements and attributes can be found here

How to install Java Plug-In in Ubuntu

I found that steps in https://jdk6.dev.java.net/plugin2/#INSTALLATION doesn't

work in Ubuntu. Java Plug-In for Firefox in Ubuntu is set in file
/etc/alternatives/xulrunner-1.9-javaplugin.so
which is symbolic link to Java Plug-In. Just make symbolic link to
.../jre/lib/{i386,sparc}/libnpjp2.so 
and rename it to {/etc/alternatives/xulrunner-1.9-javaplugin}

Pack200

Java Web Start has always supported versioned downloads, and both applets and Web Start have supported the use of Pack200 compression since it first appeared.

However, both of these features required server-side cooperation, which made them inherently difficult to work with. Even though the required servlets were provided and developers merely needed to install them, that unfortunately is not an option with many web hosts and the features were not as widely used as they might have been.

Starting in 6u10, both versioning and pack200 support are available without any special server support. You still have to enable the feature in the JNLP file or applet tag, but this is as easy as adding

<property name="jnlp.packEnabled" value=true">

or

<param name="java_arguments" value="-Djnlp.packEnabled=true">

Full documentation can be found here.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo