Java Example

Java deployment toolkit (JDT) – How to use it

The Java Deployment Toolkit allows developers to easily deploy their applets and applications to a large variety of clients. The Deployment Toolkit script is a set of JavaScript functions that, help developers deploy their rich Internet applications (RIAs) consistently across various browsers and operating system configurations.
The script evaluates the underlying browser and operating system, and automatically generates the HTML code that is required, in order for a Rich Internet Application to be deployed. Moreover, this script can also ensure that the required version of the Java Runtime Environment (JRE) software is present on the client machine. Finally, the Deployment Toolkit script was introduced in the Java Platform, Standard Edition 6 update 10 release.

Location of Deployment Toolkit Script

Important: Use the 2 nd link in order to deploy and launch your application, because the 1 st link is currently being phased out. In this way, you will avoid any content warnings when your web page is loading.

Note: The JavaScript code in these locations has been minimized so that it can load quickly. You can view the human readable version of the JavaScript code with associated comment blocks at https://www.java.com/js/deployJava.txt.

The JavaScript interpreter should be enabled in the client’s browser so that the Deployment Toolkit script can run and deploy your RIA properly.

Deploying an Applet

You can deploy applets by using the runApplet function of the Deployment Toolkit script. The runApplet function ensures that the required minimum version of the Java Runtime Environment (JRE) software exists on the client and then, runs the applet. The runApplet function generates an HTML tag with the information provided.

You can deploy applets by specifying the deployment options as attributes and parameters of the tag. You can also specify deployment options in a Java Network Launch Protocol (JNLP) file to take advantage of advanced features.

Function signature: runApplet: function(attributes, parameters, minimumVersion)

  • attributes – The names and values of the attributes of the generated tag
  • parameters – The names and values of the tags in the generated tag
  • minimumVersion – The minimum version of the JRE software that is required to run this applet
Читайте также:  Ссылки соц сетей css

    Specify the deployment options as attribute and parameter name-value pairs:
    The name-value pairs are translated into attributes and nested tags in the generated tag. An example is shown below:

  
  
    A sample name      
var attributes = ; var parameters = < jnlp_href:'javaExample.jnlp'>; var version = '1.6'; deployJava.runApplet(attributes, parameters, version);

Important: The applet tag and the JNLP file provide overlapping mechanisms to specify the same information. A developer must be aware of the specifications and how the attributes get their final value, when some deployment options have different values in the attribute name-value pairs and in the JNLP file.

Deploying a Java Web Start Application

You can deploy Java Web Start applications by using the createWebStartLaunchButton function of the Deployment Toolkit script. Java Web Start applications are launched using Java Network Launch Protocol (JNLP). The createWebStartLaunchButton function generates an HTML anchor tag, that link to the Java Web Start application’s JNLP file.

When the end user clicks the Launch button, the Deployment Toolkit script ensures that the appropriate Java Runtime Environment (JRE) software is installed and then launches the Java Web Start application.

Function signature: createWebStartLaunchButton: function(jnlp, minimumVersion) or createWebStartLaunchButton: function(jnlp)

  • jnlp – The URL of the JNLP file containing the deployment information for the Java Web Start application. This URL should be an absolute path.
  • minimumVersion – The minimum required version of the JRE software, in order for this application to be executed.

Also, a Java Web Start Application can be deployed simply by creating a JNLP file that describes only the title, vendor, java version, jar file(s), and main class of the application. Then, the application can be deployed, by simply providing a link to the JNLP file on your web page.

Many other elements can be added to the JNLP file to control the user experience, security, and update process of your application, or to take advantage of several other features of the Java Network Launching Protocol (JNLP).

If the application wants to use some advanced features of JNLP and Java Web Start, that were introduced in a particular version, you may want to ensure that at least that version is installed, before launching the Java Web Start.

Java Network Launch Protocol

The Java Network Launch Protocol (JNLP) enables an application to be launched on a client desktop, by using resources that are hosted on a remote web server. The Java Plug-in software and Java Web Start software are considered JNLP clients, because they can launch remotely hosted applets and applications on a client desktop.

  • Access to JNLP extensions.
  • Access to the JNLP APIs.
  • Version selection and more.
  • Sign the RIA using a certificate from a recognized certificate authority. Make sure that all artifacts are signed, and that the certificate has not expired.
  • Request the minimum level of permissions that is needed. If the RIA does not require unrestricted access to a user’s system, specify the permission level to be sandbox.
  • Optimize the size of “.jar” files and related resources, so that your RIA can load more quickly.
  • Enable the version download protocol and use background update checks to enable your RIA to start quickly.
  • Make sure that the client has the required version of the Java Runtime Environment software.
Читайте также:  Python задать массив случайными числами

Checking the Client JRE Software Version

There are many reasons to check if a particular version of the Java Runtime Environment (JRE) software is available on a client machine. For example, your application may require features that were introduced in the latest JRE. In case that this requirement is not satisfied, you can redirect the user to a different page, in order to download the latest JRE.

You can use the Deployment Toolkit script’s versionCheck function to check if a particular version or range of JRE versions is installed on the client.

Function signature: versionCheck: function(versionPattern)

  • versionPattern – String specifying the version or range of versions, such as such as “1.6”, “1.6.0*” (1.6.x family), and “1.7.0_02+” (any version greater than or equal to 1.7.0_02).

A sample example, where we request that at least JRE 1.6 must be installed, is shown below:

  

Источник

Deployment Toolkit

The Deployment Toolkit script is a set of JavaScript functions that can help developers deploy rich Internet applications (RIAs) consistently across various browser and operating system configurations. The Deployment Toolkit script evaluates the underlying browser and operating system, and deploys the RIA with the correct HTML. This script can also ensure that the required version of the Java Runtime Environment (JRE) software is present on the client machine. The Deployment Toolkit script was introduced in the Java Platform, Standard Edition 6 update 10 release.

Location of Deployment Toolkit Script

The Deployment Toolkit script exists at the following web addresses:

  • http://www.java.com/js/deployJava.js (See note.)
  • https://www.java.com/js/deployJava.js – When deploying your applet on a secure page, use the Deployment Toolkit script from this secure location to avoid mixed content warnings when the page is loaded.

Note: The http://www.java.com/js/deployJava.js web address is being phased out. Use the https://www.java.com/js/deployJava.js web address to launch all apps.

The JavaScript code in this location has been minimized so that it can load quickly. You can view the human readable version of the JavaScript code with associated comment blocks at https://www.java.com/js/deployJava.txt .

Читайте также:  Script type text javascript cdata if

Note: The JavaScript interpreter should be enabled in the client’s browser so that the Deployment Toolkit script can run and deploy your RIA properly.

Источник

How do I enable Java Deployment Toolkit in Firefox?

How do I enable Java Deployment Toolkit in Firefox?

You can allow the Deployment Toolkit for the currently displayed site using the Permissions panel of the Page Info dialog. You can call that up using any of these: right-click a blank area of the page and choose View Page Info > Permissions. (menu bar) Tools menu > Page Info > Permissions.

How do I remove Java Deployment Toolkit plugin from Firefox?

Tip: Visiting about://plugins url in the browser reveals at which location Java Deployment Toolkit Plugin installed on your computer. 2. Search for npDeployJava1. dll file, once Windows search finds and shows it as a result, select and delete it.

What is Java Deployment Toolkit?

What does the Java Deployment Toolkit (DT) do? The Java DT is a very useful tool, used by Java applets and applications to help manage getting the right version of Java for a user’s system. The interface automatically generates the HTML code that is required to deploy Rich Internet Applications (RIAs).

How do I remove Java from Firefox?

  1. From the Firefox menu, select Tools then click the Add-ons option.
  2. In the Add-ons Manager window, select Plugins.
  3. Click Java (TM) Platform plugin to select it.
  4. Click Disable (if the button displays Enable then Java is already disabled)

How do I plug Java into my Firefox browser?

Follow the below instructions to activate it:

  1. While you’re in Firefox, go to > Add-ons.
  2. In the Add-ons Manager window, select Plugins.
  3. Click Java (TM) Platform plugin to select it.
  4. Make sure Java is set to “Always Activate”

How do you deploy Java?

To deploy your Java Web Start application, first compile the source code, package it as a JAR file, and sign the JAR file. Java Web Start applications are launched by using the Java Network Launch Protocol (JNLP). Hence, you must create a JNLP file to deploy your application.

How do I unblock Java plugin in Firefox?

  1. Open the Firefox browser or restart it, if it is already running.
  2. From the Firefox menu, select Tools then click the Add-ons option.
  3. In the Add-ons Manager window, select Plugins.
  4. Click Java (TM) Platform plugin (Windows) or Java Applet Plug-in (Mac OS X) to select it.

What happens if the Java Deployment Toolkit is blocked?

How to fix Java issues in recent versions of Firefox?

Why does Firefox continue to state that the Java Deployment Toolkit?

What does the Java Deployment Toolkit ( DT ) do?

Источник

Оцените статью