[joe@webserver /]$ cd /var/www/html [joe@webserver /]$ sudo wget http://www.appx.com/ftp/appx/products/appx/client/4.2.a/java_web.tgz [joe@webserver html]$
[joe@webserver html]$ sudo tar xzvpf appx.tgz
appx/ appx/appx32.gif appx/appx.html appx/splash.gif appx/appx-nativelib.jar appx/appx.jar appx/appx.jnlp
[joe@webserver html]$ ls -la
total 1216 drwxr-xr-x 3 root root 4096 Mar 4 14:27 . drwxr-xr-x 10 root root 4096 Jun 26 2007 .. drwxrwxrwx 2 root root 4096 Mar 3 14:40 appx -rw-r--r-- 1 root root 1212317 Mar 4 14:27 appx.tgz
[joe@webserver html]$ cd appx [joe@webserver appx]$ ls
appx32.gif appx.html appx.jar appx.jnlp appx-nativelib.jar splash.gif
[joe@webserver appx]$ cat appx.html
<HTML> <HEAD> <TITLE>APPX Desktop Client Web Start</TITLE> <body link="#333333" vlink="#444444" alink="#106D86"> </HEAD> <BODY BGCOLOR=#146C86> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <font color=white> <center> <body bgimage=appx.jpg> <br><br><br> <hr> <font veranda> <font style=bold> <font size=13pt> <font color=white> APPX Desktop Client Web Start Demonstration <br> <h3>Clicking the icon below will attempt to detect if the correct Java JRE is installed, and if possible install it. If the installer determines you need an updated JRE but it can't auto install a JRE, it will place you on Sun's download page for your platform. After the JRE requirement is met, the APPX Desktop Client will be downloaded and launched. <hr> <br><br> <h3> <!--<A HREF="http://www.example.com/appx/appx.jnlp">Click</a> To Launch the APPX Desktop Client Demonstration--> <!-- Start of Sun's deployJava.js script that attempts to detect if Java is installed and install it or updated --> <!-- as needed for Windows, Linux and Mac. Sun encourages you to hotlink their version of the script --> <!-- because they update it as needed. At the moment, the Windows platform has the best support for detection --> <!-- This deployJava.js script is meant to replace the A HREF line above, so we've left it commented out --> <script src="http://java.com/js/deployJava.js"></script> <script> var url = "http://www.example.com/appx/appx.jnlp"; deployJava.launchButtonPNG = "http://www.example.com/appx/APPXLaunchButton.png"; deployJava.createWebStartLaunchButton(url, '1.6+'); </script> <BR> <hr> <h5>Please see our <a href=http://wiki.appx.com/wiki/bin/view/Main/LaunchingAPPXDesktopClientFromWebPageViaJavaWebstart>Wiki</a> for further documentation. </BODY> </HTML> [joe@webserver appx]$
var url = "http://www.example.com/appx/appx.jnlp"; deployJava.launchButtonPNG = "http://www.example.com/appx/APPXLaunchButton.png";
[joe@webserver appx]$ cat appx.jnlp
<?xml version="1.0" encoding="utf-8"?> <!-- JNLP File for APPX Desktop Client 5.0.0.a9 --> <?xml version="1.0" encoding="utf-8"?> <!-- JNLP File for APPX Desktop Client --> <!-- example JNLP file that will launch the APPX Desktop Client 5.0.0.a9 --> <!-- where the jnlp file lives on the web --> <jnlp spec="1.5+" codebase="http://www.example.com/appx" href="appx.jnlp" version ="5.0.0.a9"> <information> <title>APPX Desktop Client Java Web Start Demo Application</title> <vendor>APPX Software, Inc.</vendor> <homepage href="http://www.appx.com"/> <description>APPX Desktop Client version 4.2.a.</description> <description kind="short">Connects to APPX Client Login Manager.</description> <!-- hover help for this app. --> <description kind="tooltip">APPX Desktop Client 5.0.0.a9</description> <!-- This is the APPX Desktop Client application icon and splash screen. --> <!-- relative to codebase --> <icon href="appx32.gif" kind="default"/> <icon href="splash.gif" kind="splash"/> <!-- allow app to run without Internet access --> <offline-allowed /> </information> <!-- The APPX Desktop Client requires the all-permissions value for the security element --> <security> <all-permissions /> </security> <resources> <!-- Acceptable JVMs in preferred order, best first --> <!-- Sun JVM --> <j2se version="1.6.0" href="http://java.sun.com/products/autodl/j2se" /> <!-- application code, load before launch. JNLP 1.6 main="true" indicates jar with main class --> <jar href="appx.jar" main="true" download="eager" /> <nativelib href="appx-nativelib.jar"/> </resources> <!-- application class with main method --> <application-desc main-class="start.Appx"> <!-- command line arguments --> <argument>-windowTitle=APPX - $(host):$(port)</argument> <argument>-remotePort=8064</argument> <argument>-remoteUser=prospect</argument> <argument>-remoteHost=demo.appx.com</argument> <argument>-remotePassword=prospect</argument> </application-desc> </jnlp> [joe@webserver appx]$
<jnlp spec="1.5+" codebase="http://www.example.com/appx" href="appx.jnlp" version ="5.0.0.a9"> </blockquote>Table of possible element / attribute available to you in a JNLP file.
Elements and Attributes of a JNLP file Element
Attributes
Description
Since
Required
jnlp
This is the main xml element for a jnlp file. Everything is contained within the jnlp element.
1.0
yes
spec
The spec attribute can be 1.0, 1.5.0, or 1.6.0 or can use the wildcards such as 1.0+. It denoted the minimum version of the JNLP Specification that this jnlp file can work with.
1.0
codebase
The codebase attribute specifies the base location for all relative URLs specified in href attributes in the JNLP file.
1.0
href
The href specifies the URL of the JNLP file itself.
1.0
version
The version of the application being launched, as well as the version of the JNLP file itself.
1.0
information
The information element contains other elements that describe the application and it's source.
1.0
yes
os
Specifies the operating system for which this information element should be considered.
1.5.0
arch
Specifies the architecture for which this information element should be considered
1.5.0
platform
Specifies the platform for which this information element should be considered.
1.5.0
locale
Specifies the locale for which this information element should be considered.
1.5.0
title
The title element specifies the title of the application.
1.0
yes
vendor
The vendor element specifies the provider of the application.
1.0
yes
homepage
The homepage of the application.
1.0
href
A URL pointing to where more information on this application can be found.
1.0
yes
description
A short statement describing the application.
1.0
kind
An indicator as to what type of description this is, legal values are one-line, short, and tooltip.
1.0
icon
Describes an icon that can be used to identify the application to the user.
1.0
href
A URL pointing to the icon file, may be in one of the following formats: gif, jpg, png, ico.
1.0
yes
kind
Indicates the suggested use of the icon, can be: default, selected, disabled, rollover, splash, or shortcut.
1.0
width
Can be used to indicate the resolution of the image.
1.0
height
Can be used to indicate the resolution of the image.
1.0
depth
Can be used to indicate the resolution of the image.
1.0
offline-allowed
Indicates that this application can operate when the client system is disconnected from the network.
1.0
shortcut
The shortcut element can be used to indicate an application's preferences for desktop integration.
1.5.0
online
Can be used to describe the application's preference for creating a shortcut to run online or offline.
1.5.0
desktop
Can be used to indicate an application's preference for putting a shortcut on the users desktop.
1.5.0
menu
Can be used to indicate an application's preference for putting a menu item in the users start menus.
1.5.0
sub-menu
Can be used to indicate an application's preference for where to place the menu item.
1.5.0
association
Can be used to hint to the JNLP client that it wishes to be registered with the operating system as the primary handler of certain extensions and a certain mime-type.
1.5.0
extensions
Contains a list of file extensions (separated by spaces) that the application requests it be registered to handle.
1.5.0
mime-type
Contains the mime-type that the application requests it be registered to handle.
1.5.0
related-content
Describes an additional piece of related content that may be integrated with the application.
1.5.0
href
A URL pointing to the related content.
1.5.0
yes
update
The update element is used to indicate the preferences for how application updates should be handled by the JNLP Client.
1.6.0
check
Indicates the preference for when the JNLP Client should check for updates. It can be always, timeout, or background..
1.6.0
policy
Indicates the preference for how the JNLP Client should handle an application update when it is known an update is available before the application is launched. It can be always, prompt-update, or prompt-run.
1.6.0
1.0
security
This element can be used to request enhanced permissions.
1.0
all-permissions
Requests that the application be run with all permissions.
1.0
j2ee-application-client-permissions
Requests that the application be run with a permission set that meets the security specifications of the J2EE Application Client environment.
1.0
1.0
resources
Describes all the resources that are needed for an application.
1.0
yes
os
Specifies the operating system for which the resources element should be considered.
1.0
arch
Specifies the architecture for which the resources element should be considered.
1.0
locale
Specifies that the locales for which the resources element should be considered.
java (or java se)
Specifies what version(s) of Java to run the application with.
1.6.0 (java)
version
Describes an ordered list of version ranges to use.
1.0
yes
href
The URL denoting the supplier of this version of java, and where it may be downloaded from.
1.0
java-vm-args
Indicates an additional set of standard and non-standard virtual machine arguments that the application would prefer the JNLP
Client to use when launching Java.1.0
initial-heap-size
Indicates the initial size of the Java heap.
1.0
max-heap-size
Indicates the maximum size of the Java heap.
1.0
jar
Specifies a JAR file that is part of the application's classpath.
1.0
yes
href
The URL of the jar file.
1.0
yes
version
The requested version of the jar file. Requires using the version-based download protocol
1.0
main
Indicates if this jar contains the class containing the main method of the application.
1.0
download
Can be used to indicate this jar may be downloaded lazily, or when needed.
1.0
size
Indicates the downloadable size of the jar file in bytes.
1.0
part
Can be used to group resources together so they will be downloaded at the same time.
1.0
nativelib
Specifies a JAR file that contains native libraries in it's root directory.
1.0
href
The URL of the jar file.
1.0
yes
version
The requested version of the jar file. Requires using the version-based download protocol
1.0
download
Can be used to indicate this jar may be downloaded lazily.
1.0
size
Indicates the downloadable size of the jar file in bytes.
1.0
part
Can be used to group resources together so they will be downloaded at the same time.
1.0
extension
Contains pointer to an additional component-desc or installer-desc to be used with this application.
1.0
href
The URL to the additional extension jnlp file.
1.0
yes
version
The version of the additional extension jnlp file.
1.0
name
The name of the additional extension jnlp file
1.0
ext-download
Can be used in an extension element to denote the parts contained in a component-extension.
1.0
ext-part
Describes the name of a part that can be expected to be found in the extension.
1.0
yes
download
Can be used to indicate this extension may be downloaded eagerly or lazily.
1.0
part
Denotes the name of a part in this jnlp file to include the extension in.
1.0
package
Can be used to indicate to the JNLP Client which packages are implemented in which JAR files.
1.0
name
Package name contained in the jar files of the given part.
1.0
yes
part
Part name containing the jar files that include the given package name.
1.0
yes
recursive
Can be used to indicated that all package names beginning with the given name, can be found in the given part.
1.0
property
Defines a system property that will be available through the System.getProperty and System.getProperties methods.
1.0
name
Name of the system property.
1.0
yes
value
Value it will be set to.
1.0
yes
1.0
Note: A jnlp file must contain one of application-desc, applet-desc, component-desc, or installer-desc
1.0
yes
applicaation-desc
Denotes this is the jnlp file for an application.
1.0
main-class
The name of the class containing the public static void main(String[]) method of the application.
1.0
yes
argument
Each argument contains (in order) an additional argument to be passed to main.
1.0
applet-desc
Denotes this is the jnlp file for an applet.
1.0
main-class
This is the name of the main Applet class.
1.0
yes
documentbase
The document base for the Applet as a URL.
1.0
name
Name of the Applet.
1.0
yes
width
The width of the applet in pixels.
1.0
yes
height
The height of the applet in pixels
1.0
yes
param
A set of parameters that can be passed into the applet.
1.0
name
The name of this parameter
1.0
yes
value
The value of this parameter
1.0
yes
component-desc
Denotes this is the jnlp file for a component extension.
1.0
installer-desc
Denotes this is the jnlp file for an installed extension.
1.0
main-class
The name of the class containing the public static void main(String[]) method of the installer.
1.0
yes
splash.gif
This is the initial image displayed while the APPX Desktop Client is loading, it is referenced by name in the appx.jnlp file.appx.html
The appx.html file is the web document that a web browser can view. This document contains a link to a Java Web Start file (appx.jnlp). When this link is clicked, the JRE environment is installed if it doesn't exist on the client desktop, and then the APPX Desktop Client application will load. Subsequent clicks will only download updates.Configure your web server's jnlp Mime type settings.
Your webserver needs to support the .jnlp mime type. There are too many web servers and web server version that each configure via different actions, syntax or configuration file location that it is beyond the scope of this document to cover mime type configuration fully. However, this might be enough to get you on the right track if your server is not already configured for jnlp mime type support.Apache web server Mime type settings
You need to add a mime type entry for jnlp. You can either use the Apache AddType directive inside the Apache httpd.conf file or the .htaccess file, or modify the Apache web server global mime.types file. The location of this mime.types file is specified by the TypesConfig Apache directive. Apache recommends that you use the AddType directive. If you wish to modify the Apache global TypesConfig file and the file exists in /etc/mime.types, then you might try syntax like the following which will grep for the jnlp entry, and if not found will append an entry for jnlp support.Or, if you wish to modify an .htaccess file in your http://www.example.com/appx/ directory, and your web server is configured to allow .htaccess modifications then try the following syntax which will grep for the jnlp entry, and if not found will append an entry for jnlp support.[joe@webserver /]$ grep -qs 'application/x-java-jnlp-file' /etc/mime.types || echo 'application/x-java-jnlp-file jnlp' >> /etc/mime.types [joe@webserver /]$[joe@webserver /]$ grep -qs 'application/x-java-jnlp-file' /var/www/html/appx/.htaccess || echo 'AddType application/x-java-jnlp-file jnlp' >> /var/www/html/appx/.htaccess [joe@webserver /]$Microsoft IIS web server Mime type settings
Windows 2000 IIS Server
Start the IIS Management Console and perform the following steps:
- Right-click server computer in left pane, then select Properties from the drop-down menu.
- In the 'Computer MIME Map,' click the [Edit] button.
- The File Types window is displayed. Click New Type.
- In the File Type box, enter the following in the Associated Extension edit box:
- jnlp
- In the Content Type (MIME) box, enter:
- Application/x-java-jnlp-file jnlp
- Click [Ok] to close the File Type box. Click [Ok] again to close the File Types Window. Click [Ok] in the Server properties window to save the changes. Restart the IIS Admin Service.
Windows Server 2003 and XP IIS Server
Start the IIS Management Console and perform the following steps:
- Right-click server computer in left pane, then select Properties from the drop-down menu.
- In the HTTP Headers tab, click [MIME Types].
- The MIME Types window displays. Click [New].
- In the MIME Type box, enter the following in the Extension edit box:
- jnlp
- In the MIME type box, enter:
- Application/x-java-jnlp-file jnlp
- Click [OK] to close the MIME Type box. Click [OK] again to close the MIME Types Window. Click [OK] in the Server properties window to save the changes. Restart the IIS Admin Service.
Windows Vista IIS Server
Start the IIS Management Console and perform the following steps:That's all there is to publishing APPX Desktop Client utilizing Java Web Start technology.
- Double-click the MIME Types module.
- The MIME Types window displays. Click [Add] in the Action panel.
- The Add MIME Type window displays. Enter the following in the File Name Extension box:
- jnlp
- In the MIME Type box, enter:
- Application/x-java-jnlp-file jnlp
- Click [OK] to close the MIME Type window. Restart the IIS Admin Service.
Troubleshooting tips
- To clear the Web Start Cache
- javaws -uninstall This will remove all cached applications.
- Clear Browser's temporary files.
Bugs:
- Fixed - Bug Description 1.
- OPEN - Bug test - Test bug. Not valid.
Comments:
Read what other users have said about this page or add your own comments.
-- JoeOrtagus - 04 Mar 2009