Java Web Start: Difference between revisions

Content deleted Content added
mNo edit summary
m Alternatives: Typo fixing, replaced: sourc → source
 
(223 intermediate revisions by more than 100 users not shown)
Line 1:
{{Short description|Framework for running Java apps in a web browser}}
[[Image:Java WebStartApplicationMan.png|thumb|300px|'''Java Web Start''' (introduced in '''Java 2''') allows provisioning applications over the [[World Wide Web|Web]] by clicking a [[Icon (computing)|desktop icon]] or a link on a website.]]
In [[computing]], '''Java Web Start''' (also known as '''JavaWS''', '''javaws''' or '''JAWS''') is a deprecated [[Software framework|framework]] developed by [[Sun Microsystems]] (now [[Oracle Corporation|Oracle]]) that allows users to start [[application software]] for the [[Java Platform]] directly from the [[Internet]] using a [[web browser]]. The technology enables seamless version updating for globally distributed applications and greater control of memory allocation to the [[Java virtual machine]].
<!-- Deleted image removed: [[Image:Apple Java Web Start.png|left|80px]] -->
 
Java Web Start was distributed as part of the Java Platform until being removed in Java SE 11, following its deprecation in Java SE 9. The code for Java Web Start was not released by Oracle as part of [[OpenJDK]], and thus OpenJDK originally did not support it. [[IcedTea#IcedTea-Web|IcedTea-Web]] provides an independent open source implementation of Java Web Start that is currently developed by the [[AdoptOpenJDK]] community, [[RedHat]] and [[Karakun AG]], and which is bundled in some OpenJDK installers.<ref>{{Citation|title=ojdkbuild - WebStart|date=2019-04-29|url=https://github.com/ojdkbuild/ojdkbuild/wiki/WebStart/7b6f869d901b401cd2e5dd92990daad54040acd4|access-date=2019-05-31}}</ref> Next to this OpenWebStart provides an [[open source]] based implementation that is based on IcedTea-Web but offers more features and commercial support options.
In [[computing]], '''Java Web Start''' (also known as '''JavaWS''' or '''javaws''') is a [[Software framework|framework]] developed by [[Sun Microsystems]] that allows users to start [[application software]] for the [[Java Platform]] directly from the [[Internet]] using a [[web browser]].
 
== Functionality ==
Unlike [[Java applet]]s, Web Start applications do not run inside the browser. By default they run in the same [[sandbox (computer security)|sandbox]] as applets, with several minor extensions like allowing to load and save the file that is explicitly selected by the user through the file selection dialog. Only [[Digital signature|signed]] applications can be configured to have additional permissions.
 
Unlike [[Java applet]]s, Web Start applications do not run inside the browser, and the [[sandbox (computer security)|sandbox]] in which they run need not have as many restrictions, although this can be configured. Web Start has an advantage over applets in that it overcomes many compatibility problems with browsers' Java [[Plug-in (computing)|plugin]]s and different [[Java virtual machine|JVM]] versions. On the other hand, Web Start programs cannotare communicateno withlonger thean browserintegrated aspart easilyof asthe applets. To assistweb migrationpage, usersthey canare alsoindependent invokeapplications athat Javarun Applet asin a Java Web Startseparate applicationframe.
 
Web Start can also launch unmodified applets that are packaged inside .jar files, by writing the appropriate JNLP file. This file can also pass the applet parameters. Such applets also run in a separate frame. Applet launcher may not support some specific cases like loading class as resource.
 
Like applets, Java Web Start is [[cross-platform]].
 
== Deprecation ==
With [[Java version history|JDK9]], several deployment technologies including applets and Java Web Start were deprecated by Oracle.<ref>
[http://www.oracle.com/technetwork/java/javase/9-deprecated-features-3745636.html JDK9 Release Notes]
</ref><ref>{{cite web |url=https://blogs.oracle.com/java-platform-group/moving-to-a-plugin-free-web |title=Moving to a Plugin-Free Web |date=January 27, 2016 |first=Dalibor |last= Topić }}</ref>
 
In March 2018, Oracle announced it will not include Java Web Start in Java SE 11 (18.9 LTS) and later. Developers will need to transition to other deployment technologies.<ref>{{Cite web|url=http://www.oracle.com/technetwork/java/javase/javaclientroadmapupdate2018mar-4414431.pdf|title=Java Client Roadmap Update|date=March 2018|quote=Oracle will not include Java Web Start in Java SE 11 (18.9 LTS) and later. Oracle will begin encouraging application developers and users to transition away from Java Web Start and encourage non-commercial consumers to remove any unused or non-supported Oracle JRE installations from their desktops.}}</ref> A few stand-alone [[#Alternatives|alternatives]] have since arisen.
 
== Implementation ==
[[Image:Java WebStartApplicationMan.png|thumb|250px|Early versions of Java Web Start came with an application manager where, e.g., Sun's demo applications could be launched]]
 
The developer prepares a special XML file with JNLP extension. This file describes the application requirements, code ___location, parameters and additional permissions (if any). The browser downloads this file as any other and (following its [[MIME type]], <code>application/x-java-jnlp-file</code>) opens it with Web Start tool. Web Start tool downloads all necessary resources and launches the application.
 
Java Web Start provides a series of [[Class (computer science)|class]]es in the <code>[http://java.sun.com/products/javawebstart/docs/javadoc/index.html javax.jnlp]</code> [[Java package|package]] which provide various services to the application. Sun designed most of these services with the aim of allowing carefully controlled access to resources (such as files and the system clipboard) while restricting the application to authorized operations.
 
Sun introduced version 1.0 of Web Start in March 2001.,<ref>
[http://www.sun.com/smi/Press/sunflash/2001-03/sunflash.20010314.1.html Java Web Start 1.0 press release]
</ref> while 64-bit Windows support was added only in Java 6<ref name="win64">[http://bugs.sun.com/view_bug.do?bug_id=4802695 Bug ID 4802695, Support 64-bit Java Plug-in and Java webstart on Windows/Linux on AMD64]</ref> (later than 64-bit Java was first available). Since [[Java Platform, Standard Edition|J2SE]] 1.4 Web Start comes as a default part of [[Java Runtime Environment]] (JRE) called <code>javaws</code>, and computer administrators no longer have to install it separately.
Microsoft's [[.NET Framework|.NET]] framework's [[ClickOnce]] is similar to Java Web Start.
 
== Java Network Launching Protocol (JNLP) ==
 
Programmers often speak of the '''Java Network Launching Protocol''' ('''JNLP''') interchangeably with the term "Web Start". The JNLP protocol, defined with an [[XML]] schema]], specifies how to launch Java Web Start applications. JNLP consists of a set of rules defining how exactly to implement the launching mechanism. JNLP files include information such as the ___location of the [[Jar (file format)|jar]] package file and the name of the main class for the application, in addition to any other parameters for the program. A properly configured browser passes JNLP files to a Java Runtime Environment (JRE) which in turn downloads the application onto the user's machine and starts executing it. The development of JNLP took place under the [[Java Community Process]] as JSR 56. {{Clarify span|text=It includes the original 1.0 release, the subsequent 1.5 maintenance release, and {{as of | 2006 | lc = on}}, the pending 6.0 maintenance release.|date=April JNLP comes free of charge; developers need not pay a license fee in order to use it in programs.2013}}
Important Web Start features include the ability to automatically download and install a JRE in the case where the user does not have Java installed, and for programmers to specify which JRE version a given program needs in order to execute. The user does not have to remain connected to the Internet to execute the downloaded programs, because they execute from a locally-maintained [[cache]]. Updates of the software download from the Web become available when the user has a connection to the Internet, thus easing the burden of deployment.
 
Important Web Start features include the ability to automatically download and install a JRE in the case where the user does not have Java installed, and for programmers to specify which JRE version a given program needs in order to execute. The user does not have to remain connected to the Internet to execute the downloaded programs, because they execute from a locally maintained [[cache (computing)|cache]]. Updates of the software download from the Web and become available when the user has a connection to the Internet, thus easing the burden of deployment.
Any computer user can use JNLP by simply installing a JNLP client (most commonly Java Web Start). The installation can occur automatically such that the end user sees the client launcher downloading and installing the Java application when first executed.
 
Any computer user can use JNLP simply by installing a JNLP client (most commonly Java Web Start). The installation can occur automatically such that the end-user sees the client launcher downloading and installing the Java application when first executed.
JNLP works in a similar fashion to how HTTP/HTML works for the web. For rendering a HTML [[webpage]], after the user clicks on a weblink, the browser submits a URL to a [[webserver]], which replies with an HTML file. The browser then requests the resources referred to by this file (images, [[cascading style sheets|css]]), and finally renders the page once it has received enough information. Page rendering usually starts before all resources have downloaded; some resources not critical to the layout of the page (such as images), can follow on afterwards — or on request if the "Load Images Automatically" browser-setting remains unset.
 
JNLP mirrors this process;works in thea samesimilar wayfashion thatto ahow WebHTTP/HTML browserworks rendersfor athe webpage,web. For a[[web JNLPbrowser clientengine|render]]ing "renders"an aHTML [[Java application|Java appwebpage]]. , Afterafter the user clicks on a weblink, the browser submits a URL to a [[webserver]], which replies with a JNLP file (instead of aan HTML file) for the application. The JNLPbrowser client parses this file,then requests the resources specifiedreferred (jarto files),by waitsthis forfile the(images, retrieval[[cascading ofstyle all required resourcessheets|css]]), and thenfinally launchesrenders the application.page Theonce JNLPit filehas canreceived listenough resourcesinformation. asPage "lazy",rendering whichusually informsstarts thebefore JNLPall clientresources thathave thedownloaded; applicationsome doesresources not need those resourcescritical to start,the butlayout canof retrievethe thempage later(such onas when/ifimages) thecan applicationfollow requestson themafterwards.
 
JNLP mirrors this process; in the same way that a Web browser renders a webpage, a JNLP client "renders" a [[Java application|Java app]]. After the user clicks on a weblink, the browser submits a URL to a webserver, which replies with a JNLP file (instead of a HTML file) for the application. The JNLP client parses this file, requests the resources specified (jar files), waits for the retrieval of all required resources, and then launches the application. The JNLP file can list resources as "lazy", which informs the JNLP client that the application does not need those resources to start, but can retrieve them later on when/if the application requests them.
 
== Example ==
{{original research|section|date=September 2020}}
The example below gives a simple JNLP file to launch the applet, specifying code base, source, main class and window size. Such file contains all necessary references and is self-sufficient to launch the application. As no permissions are requested, the code will run in a sandbox. JNLP also states that this application can run offline (if already cached) and should be updated as a background process.
 
<syntaxhighlight lang='xml'>
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://ultrastudio.org/upload" href="">
<information>
<title>Launch applet with Web Start</title>
<vendor>Foo Bar Inc.</vendor>
<offline-allowed/>
</information>
<resources>
<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="Ray-2.3-4ca60e46-0956-3f22-983c-e3ed986dfd03.jar" main="true" />
</resources>
<applet-desc name="Ray diagram applet" main-class="raydiagramsapplet.Main" width="300" height="200">
</applet-desc>
<update check="background"/>
</jnlp>
</syntaxhighlight>
 
== Pack200 compression ==
To reduce the size of a Java Web Start application Sun Microsystems introduced a compression system called [[Pack200]] in Java 1.5.0. It reduces byte counts so efficiently that it can compress a large jar file to one-ninth of its original size if it contains only Java classes.<ref>[http://java.sun.com/j2sejavase/1.5.06/docs/guidetechnotes/guides/deployment/deployment-guide/pack200.html#pack200_compression Pack200 and Compression for Network Deployment]</ref>
 
Java Web Start has supported Pack200 since it first appeared, but initially this feature required server-side cooperation and a certain amount of expertise to set up. When SUNSun introduced Java SE 6u10, Pack200 support became available without the need for special server support. Application designers can enable or disable this feature within JNLP files.
 
On slow connections Pack200 gives a performance boost in application startup time and download time.
Line 40 ⟶ 76:
By default, Java Web Start applications run "restricted", which means that they do not have access to some system resources such as local files. But publishers can remove these restrictions by signing their Web Start applications with the <code>jarsigner</code> tool that comes with the [[Java Development Kit|JDK]].
 
== CriticismAlternatives ==
{{see also|IcedTea#IcedTea-Web}}
The open-source [[IcedTea]] project provides an alternative JNLP implementation in ''IcedTea-Web''. As of version 1.7.2, it also works on newer versions without official JWS support.<ref>[https://github.com/adoptopenjdk/icedtea-web/ icedtea-web]. open source implementation of web start</ref>
 
To run Java Web Start-based application after the release of Java 11, the company [[Karakun AG]] has released the open source tool [[:de:OpenWebStart|OpenWebStart]], based on IcedTea-Web.<ref>{{Cite web|title=OpenWebStart|url=https://openwebstart.com/|access-date=2020-07-20|website=OpenWebStart|language=en}}</ref> The tool includes all the functionality of IcedTea-Web and adds extended features, such as native installers for Mac OS, Windows, and Linux. IcedTea-Web was created with support from [[RedHat]] and [[AdoptOpenJDK]].<ref>{{Cite web|last=hendrik|date=2019-12-10|title=How open source saved WebStart|url=https://guigarage.com/2019/12/10/webstart-advent.html|access-date=2020-07-20|website=GuiGarage|language=en}}</ref>
Some of problems with JNLP are:
 
== Notable applications ==
* Developer has to write server URI in JNLP file, so it is not possible to use same JNLP descriptor file in production and testing environment. Developer cannot just drop .jnlp file into server shared directory, he or she has to edit it. This problem could be solved if .jnlp file opened directly by web browser plugin (which is done when using the Java Deployment Toolkit, deployJava.js)[http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6866509] (as for [[Java Applet|applets]]), or by introducing jnlp: URI scheme, so .jnlp file descriptor opened by URL like jnlp:http://my-site/app.jnlp. jnlp: URI scheme may be handled by JNLP handler.{{Citation needed|date=November 2009}}
{{unreferenced section|date=October 2018}}
* Developer has to sign with certificate all jar files used by JNLP. Although it is not a problem for serious production applications, it complicates learning and small applications development. Certificate may be self-signed, so this does not really solve security issues.{{Citation needed|date=November 2009}}
* [[ArgoUML]] &ndash; an [[Unified Modeling Language|UML]] diagramming application.
* Bad user experience: user downloads .jnlp file into temp directory or Downloads folder. Browser may ask user, if he really wants to save that .jnlp file, and then has have to open downloaded manually. This again could be solved by browser plugin (which is done as of Java 6 Update 10 and using the Sun Java Deployment Toolkit, deployJava.js), or by introducing jnlp: URL scheme.{{Citation needed|date=November 2009}}
* [[CrossFTP]] &ndash; an FTP client and server.
* Permission checking is too simple. Developer hardcodes required permissions into .jnlp descriptor (for example, developer may request "all permissions"), and user has to confirm permissions once at application start, or perhaps during runtime.
* [[Elluminate Live]] &ndash; a web conferencing / virtual classroom program.
* 64-bit Windows support added only in Java 6<ref name="win64">[http://bugs.sun.com/view_bug.do?bug_id=4802695 Bug ID 4802695, Support 64-bit Java Plug-in and Java webstart on Windows/Linux on AMD64]</ref>.
* [[Ganymede (software)|Ganymede]] &ndash; a GPL-licensed network directory management system
 
== Well-known applications ==
* [[CrossFTP]] &ndash; a user friendly FTP client and server
* [[Genie Workbench]] &ndash; a set of film production automation tools.
* [[Genevestigator]], access engine to the curated bioinformatical database.
* [[PowerFolder]] &ndash; a popular network sync and sharing freeware.
* [[Jake2]] &ndash; A Java port of Quake 2.
* [[PowerTeacher]] &ndash; a gradebook program for student scores: part of the [[PowerSchool]] student information system used by schools
* [[PoxNoraJOSM]] &ndash; aThe [[3/4 perspective]],Java [[turn-based strategyOpenStreetMap]], [[collectible card game]]editor.
* [[muCommander]] A file Manager and Norton Commander clone with SSH and ftp features
* [[PoxNora]] &ndash; a [[3/4 perspective]], [[turn-based strategy]], [[collectible card game]].
* [[Wurm Online]] &ndash; a 3D Massively Multiplayer Online Fantasy Simulator.
* [[yEd]] &ndash; a graph and diagram editor.
 
== See also ==
{{Portal|Java|Wave.svgComputer programming}}
* [[ClickOnce]], [[Microsoft]] [[.NET Framework|.NET]]'s similar framework.
* [[Java applets]], another Java application deployment technology
* [[Zero Install]], a similar system which works for non-Java applications.
* [[ClickOnce]]
* [[RUNZ]]
 
== References ==
{{reflistReflist}}
 
== External links ==
* [httphttps://javadocs.sunoracle.com/productsjavase/javawebstart8/docs/technotes/guides/javaws/ Sun's Java Web Start product page]
* [http://java.sun.com/developer/technicalArticles/Programming/jnlp/ Deploying Software with JNLP and Java Web Start]
* [http://java.sun.com/products/javawebstart/download-spec.html Java Web Start Architecture JNLP Specification & API Documentation]
* [http://www.jcp.org/en/jsr/detail?id=56 JSR 56] (JNLP 1.0, 1.5 and 6.0)
* [http://www.connectandwork.com/external Startdirectory Connect and Work]
* [http://articles.techrepublic.com.com/5100-3513-6120125.html Java Web Start tutorial]
* [http://today.java.net/pub/a/today/2005/08/11/webstart.html Getting Started with Java Web Start]
* JNLP implementations other than Sun's reference implementation:
** [http://openjnlp.nanode.org/ OpenJNLP]
** [http://jnlp.sourceforge.net/netx/ netx]
** [http://xito.sourceforge.net/ xito]
 
{{Java (Sun)}}
 
[[Category:Java platform|Web Start]]
[[Category:Java specification requests|Web Start]]
[[Category:2001 introductionssoftware]]
 
[[de:Java Web Start]]
[[es:Java Web Start]]
[[fr:Java Web Start]]
[[he:Java Web Start]]
[[nl:Java Web Start]]
[[ja:Java Web Start]]
[[pl:Java Web Start]]
[[ru:Java Web Start]]