FAQ JavaTM Web Start version 1.5.0 - Frequently Asked Questions (FAQ)
FAQ Update (March 2006) 1. 2. 3. 4. 5.
Where can I find the Web Start chat session transcripts from March, 2005? What are some troubleshooting hints for Web Start applications? What is the story on auto-downloading jres? How do you use the CD install feature? How do you use the new Enterprise Configuration features?
General Questions 1. What is Java Web Start? 2. Where do I get more information? 3. Why should I use Java Web Start? 4. How can I launch applications with Java Web Start? 5. Does it matter how I launch an application? 6. What are the system requirements for Java Web Start? 7. What platforms does Java Web Start run on? 8. What are the server requirements for Java Web Start? 9. Is Java Web Start based on a standard? 10. Can I implement my own Java Web Start? 11. What are the supported browsers? 12. Is there a comprehensive list of online resources for Java Web Start? 13. Can I deploy any application with Java Web Start? 14. Is Java Web Start a software distribution mechanism like Marimba and MS SMS? 15. Is Java Web Start an application installer? 16. What version of the Java platform does Java Web Start work with? 17. How does Java Web Start relate to Java Plug-in Technology (applets)?
Technical Questions 1. 2. 3. 4. 5. 6. 7. 8.
Do I need to change my application to work with Java Web Start? Is there a migration path from applets to applications? Is there a way to pass VM arguments to the Java Runtime? I don't want to rely on a server timestamp. How can I specify a versioned JAR and how can I get incremental updates of JARs? Are JAR files shared between applications? How can I provide my own splash screen? How can I save the application state on the local system? My application requires a specific version of the JRE. How do I specify this my JNLP file?
1
9. 10. Can I rely on Class-Path in the manifest file? 11. Can I use Java Web Start even if my Application depends on or uses native code? 12. How can I load resources within my application using Class.forName and ClassLoader.getSystemClassLoader? 13. How can I launch Java Web Start from the command line? 14. How do I use multiple JAR files signed by different certificates? 15. How do I detect if Java Web Start is installed? 16. Why does my browser shows JNLP file as plain text. 17. Why does Java Web Start always reload JAR files from IIS server? 18. Can I use Pack200 compression with the JnlpDownloadServlet? 19. What is the best way to ensure only one instance of my app is run? 20. When will properties set in the jnlp file get set? 21. What causes the file not found message for the downloaded jnlp file? 22. How can I use signed jars (such as JCE extensions) signed for other purposes? 23. Why can't I use the Association feature on some linux platforms with Gnome? 24. How do I set up my server to broadcast the jnlp mime type? 25. How do I set up my server to use the JnlpDownloadServlet? 26. How are Applications uniquely identified? 27. How do I create multiple file-extension/mime-type associations with a JNLP application?
Security Questions 1. 2. 3. 4. 5. 6. 7. 8.
How secure is Java Web Start? What is a secure sandbox? How is the Java Web Start secure sandbox more flexible than the applet sandbox? How can I enable my application to gain unrestricted access to the system? Is there support for encrypted download of JAR files? Can I use NTLM authentication with Java Web Start? Can I use HTTPS protocol with Java Web Start? Are there online resources to learn more about the security tools?
Known Bugs 1. 2. 3. 4.
4825415: Web Start desktop integration and security dialogs disappear in 1.4.2 4491398: Dependent DLL resource problem 5008460: Web Start fails if path contains spaces and TraceSecurity is turned on. 5074087: If related-content is specified w/o a title on Windows, application cannot start.
5074524: First jar of unsigned extension must be downloaded eagerly 5.
2
6. 5047548: Lazy downloading of parts with packages is broken 7. 5074526: ExtenededService file APIs show security dialog even if app is signed 8. 4925768: No support for system level shortcuts in Gnome. 9. 5072969: Startup errors causing Web Start to appear to hang 10. 5074530: Web Start not picking up the correct JRE.
March 2006 Updates: Where can I find the Web Start chat session transcripts from March, 2005 ? The chat session transcripts can be seen here. What are some troubleshooting hints for Web Start applications? See the notes on troubleshooting and debugging here
What is the story on auto-downloading jres? See the notes on auto-download here How do you use the CD install feature? See the notes on the import feature and CD-Install here How do you use the Enterprise Configuration features? See the notes on enterprise configuration management here
General Questions What is Java Web Start? Java Web Start provides a platform-independent, secure, and robust deployment technology. It enables developers to deploy full-featured applications to end-users by making the applications available on a standard web server. With any web browser, endusers can launch the applications and be confident they always have the most-recent version. Back to top
Where do I get more information? Look at the online documentation for Java Web Start .
3
If you are a developer, go to the Developer's Guide for detailed technical information on how to deploy applications using Java Web Start. Back to top
Why should I use Java Web Start? It's an easy, robust, and secure way to deploy applications directly from the web. Developers can make applications readily available via the web. In addition, Java Web Start provides Java runtime environment (JRE) management capabilities, it's easy to set up, it's browser-independent, and it's an efficient way to deploy web application solutions. Users can easily access applications much as they would a web page--without a separate installation step. From the desktop, users can access and use Java applications, using a richer and more responsive user interface than is available on a web page. And, once a Java Web Start based application is installed, users simply click to run the application whenever needed. Users do not need to manually update applications because each time they launch an application, it is transparently updated from the web--so they always use the most recent version available. Back to top
How can I launch applications with Java Web Start? You initially launch a new application by clicking on a link from a web page. If you use an application frequently, create a shortcut from your desktop or from the Start Menu by allowing Java Web Start to place an icon on your desktop. Java Web Start may ask if you would like to create shortcuts or an entry in the Start Menu. If you say "yes," all future launches of the application can start without a browser. Java Web Start also provides an Application Cache Viewer which you can launch from the Java Control Panel. The Cache Viewer enables you to directly launch applications you have downloaded. You can also launch an application from a command prompt by typing “javaws <jnlp_url>” where <jnlp_url is a url to the jnlp file of the application. Back to top
Does it matter how I launch an application? No, applications launch in the same manner no matter which method you use: from a web page, from the shortcut on the desktop, from the Start menu, or through the Java Application Cache Viewer.
4
Java Web Start always checks to see if a newer version of the application is available for use and automatically downloads it if so. If the application you are using has not been digitally signed, Java Web Start will launch it in a restricted and secure execution environment. An application that is not signed, or one that you do not trust, will never be run with unrestricted access to your local system or network. Back to top
What are the system requirements for Java Web Start? Any client system that supports the Java version 1.2.2 or higher can use Java Web Start. Java Web Start works with virtually all browsers. Back to top
What platforms does Java Web Start run on? Sun Microsystems provides versions for Windows 98/NT/2000/XP/2003, Solaris Operating Environment (SPARC and Intel editions) and Linux/i486. Apple provides a version for their OS X release. Back to top
What are the server requirements for Java Web Start? Java Web Start uses HTTP for communication between the client and the server. You can use a standard web server to host an application. If you require additional services, such as version-based downloading, incremental updates, or pack200 compression for your applications, the web server will need to support servlets or Java Server Pages. A sample servlet implementing these features is provided in the samples directory of the JDK. Back to top
Is Java Web Start based on a standard? Yes. Java Web Start 1.5.0 is the product-quality reference implementation of Java Network Launching Protocol (JNLP) technology, which was developed through the Java Community Process. JNLP is specification number JSR 056. Other platform vendors are encouraged to port Java Web Start to their platform or implement the specification. For more information, see the JNLP specification. Can I implement my own Java Web Start? The underlying technology for Java Web Start, the Java Network Launching Protocol and API is being developed through the Java Community Process, so you can implement this protocol in any product. However additional licensing and terms must be met to
5
implement any JCP technology including the JNLP technology. Back to top
What are the supported browsers? Java Web Start supports primarily Internet Explorer 4 or higher and Mozilla. However any browser can launch JNLP files if you have set the MIME-type association correctly. Java Web Start uses the browser's settings and may launch a browser to show a URL; this feature may not work with unsupported browsers. Back to top
Is there a comprehensive list of online resources for Java Web Start? • • • •
Java Web Start documentation page: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/index.html Developer's Guide: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/contents.html Java Web Start Discussion Forums: http://forum.java.sun.com/forum.jsp?forum=38 JSR-56: http://jcp.org/en/jsr/detail?id=56
Back to top
Can I deploy any application with Java Web Start? Java Web Start is an application launcher for Java applications that are written to be webdeployed. An application must be delivered in a set of JAR files and all application resources, such as images, configuration files, and native libraries must be included in the JAR files. The resources must be looked up using the method ClassLoader.getResource() or an equivalent method. Java Web Start only transfers JAR files from the web server to the client. If an application is written to run in a restricted execution environment (sandbox), then access to disk is not permitted and the application may only connect to the host on which it resides. Is Java Web Start a software distribution mechanism like Marimba and MS SMS? Java Web Start is an application launcher for Java applications. It allows easy distribution of full-featured applications based on the Java platform from a web server to a client machine with minimal user interaction. The software distribution technology is only one aspect of Java Web Start. It also provides security, updates to the applications, ease-of-use for end users, and flexibility for 6
developers when they create the applications. Back to top
Is Java Web Start an application installer? Java Web Start is an application launcher for Java applications that are written to be webdeployed. Java Web Start caches resources locally on the disk, but also provides a secure execution environment and a virtually transparent updating facility for applications. The end user does not need to manually initiate a software update because the application is updated each time it is used. Back to top
What version of the Java platform does Java Web Start work with? Java Web Start launches only applications written for the Java platform versions 1.2.2 and higher. Back to top
How does Java Web Start relate to Java Plug-in Technology (applets)? The two approaches are very similar. The key difference is in the user experience. If the Java application/applet needs to interact with a web page and be tightly bound to a web browser, then applets may be the solution. On the other hand, if browser independence is important, then Java Web Start is the deployment platform of choice. There are a number of other differences, but this is the fundamental difference. Java Plug-in technology enables users to run Java applets inside a browser. Java Web Start enables users to download full-featured applications with any browser. Once they have downloaded and launched an application, the browser can be closed, while the application continues working. The application does not depend on an open browser to function. The browser can be shut down or you can go to a different web page and the application will continue running.
Technical Questions Do I need to change my application to work with Java Web Start? If your application is written to the Java 2 platform, and is delivered as a set of JAR files, there should be no need to revise your application. Make sure that your application retrieves all its resources (such as images and resource bundles) from a JAR file, since Java Web Start launches an application by invoking the public static void main(String[] args) method.
7
If your application needs unrestricted access to the system, (for example, network or disk access), you will need to sign your code. Back to top
Is there a migration path from applets to applications? Java Web Start is primarily designed for application deployment. You specify all requirements for your application in the JNLP file, and off you go. It does provide the ability to launch applets in much the same way as the traditional AppletViewer. The builtin AppletViewer provides an easy migration path for existing applets that want to take advantage of Java Web Start. However, it is not intended to be a full implementation of the Plug-In. The Plug-In is the primary launching vehicle for applets. The built-in AppletViewer in Java Web Start has limitations, for example, you cannot specify class files as resources and it does not accept policy files. Back to top
Is there a way to pass VM arguments to the Java Runtime? Java Web Start allows certain JVM flags to be set with the java-vm-args attribute of the j2se element (see Developer's Guide). Allowing the complete set could compromise security as well as limit portability across different platforms and implementations. You can set the maximum and initial heap size using the initial-heap-size and max-heap-size attributes of the j2se element, for example: <j2se version="..." max-heap-size="100M"/> Back to top
I don't want to rely on a server timestamp. How can I specify a versioned JAR and how can I get incremental updates of JARs? Java Web Start supports versioned JARs and incremental updates. You can specify exact versions of the JAR files you want, instead of relying on timestamp information to determine if an update is available. Using version IDs also allows you to provide incremental updates from one version to another. See the JNLP Specification or the Developer's Guide for details. Are JAR files shared between applications? Each JAR file that a JNLP Client (such as Java Web Start) downloads, is uniquely identified with a URL. If two JNLP files use the same URL, then the resource will only be downloaded once and shared. This is similar to the caching implementations used by web browsers. Back to top
8
How can I provide my own splash screen? Java Web Start needs to put up the initial splash screen while Java is loading. For subsequent access, you can specify an image file to use for the splash screen in the JNLP file with the tag
where mysplash.jpg is the image file for your splash screen. The first time your application runs, it will use the standard splash screen. After that, it will use the image you provide. Back to top
How can I save the application state on the local system? A sandboxed application can store state using the PersistenceService API. This API is similar to cookies for HTML pages. Thus, it is a secure way to store persistent information on the client computer. For more information, see: • •
JNLP Specification Java Web Start Developers Guide
Back to top
My application requires a specific version of the JRE. How do I specify this my JNLP file? The tag <j2se version="versionNum"> specifies a platform version, where versionNum is 1.2, 1.3, 1.4, or 1.5. You can request a specific product version by including a vendor URL in the href attribute. For Sun's JREs, the URL is http://java.sun.com/products/autodl/j2se For example, the following J2SE tag will request any Sun 1.3.1 implementation: <j2se version="1.3.1*"
href="http://java.sun.com/products/autodl/j2se"/>
You can see all the versions of the installed JREs in the Java tab of the Java Control Panel. Back to top
Can I rely on Class-Path in the manifest file? Java Web Start does not support the Class-Path entry in the manifest file. The Class-Path attribute is entirely file-centric, whereas Java Web Start and JNLP is web-centric, i.e., based on URLs. Thus, the two models do not merge easily.
9
Instead of relying on the Class-Path entry, you can list multiple JAR files in the JNLP file, for example: <jar href="A.jar"/> <jar href="B.jar"/>
In a JNLP file, you can factor out dependencies on a set of JAR files to another JNLP file using the <extension... > element. Thus, you can achieve the same kind of re-usability and ease of maintenance as you do with the Class-Path entry. This feature is described in the specification. JNLP also implements a just-in-time downloading mechanism, similar to applets. For each resource in a JNLP file, you can specify which parts should be eagerly or lazily downloaded. Eagerly loaded resources are loaded before the application is launched, lazily loaded resources later. Default is eager download. Furthermore, the specification includes an API for which you can programatically query Java Web Start about which resources are available and request them to be downloaded. Thus, you can write download/network aware applications. See the JNLP specification for more information. Back to top
Can I use Java Web Start even if my application depends on or uses native code? You can use Java Web Start to deploy Java Technology-based applications that depend on native code such as DLLs and SOs. Use the element to specify required native libraries. See the Developer's Guide for details. Back to top
How can I load resources within my application using Class.forName and ClassLoader.getSystemClassLoader? Java Web Start uses a user-level classloader to load all the application resources specified in the JNLP file. This classloader implements the security model and the downloading model defined by the JNLP specification. This is no different than how the AppletViewer or the Java PlugIn works. This has the, unfortunate, side-effect that Class.forName will not find any resources that are defined in the JNLP file. The same is true for looking up resources and classes using the system class loader (ClassLoader.getSystemClassLoader).
10
To find application resources in Java Web Start, use the classloader that loaded your application, for example use the following call in the in the application;s main thread: this.getClass().getClassLoader();
You can also use: Thread.getCurrent().getContextClassLoader(); Back to top
How can I launch Java Web Start from the command line? You can launch Java Web Start from the command line as follows: javaws [options] your-app-JNLP-URL
where your-app-JNLP-URL is the location of your application's JNLP file. For example: javaws
http://java.sun.com/products/javawebstart/apps/swingset2.jnlp
For complete command line syntax see: the Developer's Guide Back to top
How do I use multiple JAR files signed by different certificates? The JNLP 1.0 specification requires all JAR files used in a JNLP file to be signed by the same certificate. This restriction avoids requiring the user to accept multiple certificates from the same source, and enables Java Web Start to know if the user has accepted all certificates used for an application. However, Java Web Start can use multiple JAR files signed by different certificates, by using the component extension mechanism and multiple JNLP files. The only requirement is that the JAR files contain code from different packages. So, instead of the following: <jar href="myjar1.jar"/> <jar href="jh.jar"/>
11