The first time a user downloads a Web Start application, they need to download the Java Web Start client. That client includes a JVM and an application manager that allows the user to configure Web Start and any downloaded Web Start applications.
To run Webstart apps Mac OS 10.8 of 10.9, see this video: http://www.youtube.com/watch?v=k096TK3Pzd8
There are at least two types of Web Start downloads available from the Ptolemy site:
Web Start Features:
The best thing about Web Start is that it is easy to update a small part of the application and then the next time the users run the app, they will download just the updated portion instead of having to download the entire application and reinstall.
The way Web Start works is that developers create jar files that are collections of Java .class files, images, platform dependent libraries and other resources. An application consists of multiple jar files and a .jnlp file that describes the application.
Since shipping a standalone installer usually requires splitting an application up into components anyway, then the exercise of building jar files is a useful one, since the jar files could be used for other installers such as InstallAnywhere or InstallShield. I use Web Start as a test bed for figuring out which files need to be shipped. Using Web Start for this is usually much faster than running InstallAnywhere or InstallShield, since if there is a problem in only one jar file, then only that jar file is affected, and I don't necessarily need to rebuild a large installer.
In theory, one can ship one large jar file, but that makes updating the application more difficult, since if the application changes, the entire jar file will be downloaded unless a somewhat more complex jar diff system is used.
The jar files and the .jnlp file may or may not be signed by using a Sun Java code signing certificate. If all the jars are signed, then the application can have access to the local disk, and basically looks like a regular application. If the jars are not signed, then access is limited. It is also possible to run the application in 'sandbox' mode, which is fairly restrictive, but can still do some useful things.
One can use a temporary code signing certificate and eventually pay Verisign $400/year for a permanent code signing certificate.
The basic procedure is that Web Start is included as part of the Java Runtime Environment (JRE) and the Java Development Kit (JDK). After the JRE or JDK is installed it is sometimes necessary to restart your web browser. At runtime, a .jnlp file is downloaded and the browser invokes Java.
Open using javaws.exe
and then OK
, and the Java Web Start splash screen should come up.
javaws
command on the downloaded .jnlp file. See Mac OS X 10.5: Unable to launch Java Web Start JNLP file after installing Java Update
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Claudius Ptolemaus
is unknown.
You should hit the OK
button to proceed with the download
Java
). The Java Control Panel with start up.
Advanced
->
Shortcut Creation
.
Advanced
->
Java Console
controls two output options that
are useful for troubleshooting
Show Java Console
Log Output
Application
-> Remove Application
Under recent versions of Mac OS X, clicking a Web Start JNLP file results in a dialog that states that the application is from an unsigned developer.
There are at least three workarounds:
.jnlp
file is downloaded and typically saved in the ~/Downloads
directory. Find the .jnlp
file in the Mac OS X Finder, right click on the file and select Open With -> Java Web Start. The summary is that Java is not very well supported under Firefox on the Mac.
Under Mac OS X, if you have problems with Web Start under Firefox, try using Safari.
Below are some things to try under Mac OS X for Firefox. In theory the JavaScript that is invoked by the "Launch" button should install the Oracle JRE, but in practice, there are problems.
There are problems with Java 3D 1.2.1_03 API under JDK1.4.0, when I run a Java3D app, we get:
Fail to create back buffer - DDERR_INALIDPARAM
The workaround is to use JDK1.3.1
Below are some instructions on installing Java3D:
Go to
https://java3d.dev.java.net/
and download
Java 3D for Windows (DirectX Version) Runtime for the JRE
Click on the installer. Eventually, it will prompt you for the JRE to install Java 3D in. You should install it under the same JRE that you are running in Web Start. There are at least two ways to determine which JRE you are running:
View
->
JVM Properties
and look at the java.home
property. The value of the java.home
property should be something like
C:\Program Files\JavaSoft\Java\jre7
(Windows) or
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
(Mac OS X)
BTW - This value is the JRE that Java 3D should be installed in.Developers: see $PTII/mk/jnlp.mk (search for Java3D
) for how to create your own signed Java3D files.
Help
-> about
,
the splash window is the standard full installation window which
includes links to domains and demos that are not included in
the Ptiny release.
$PTII/vergil.jnlp.in
,
$PTII/vergilPtiny.jnlp.in
and
$PTII/vergilPtiny.jnlp.in
.
$PTII/mk/jnlp.mk
contains
the rules that process the *jnlp.in
files and generates
*.jnlp
files.
If the Web Start application is to have full access to the machine,
then the application needs to be signed, which means that the
.jnlp
file needs to be copied into the jar file that has
the main()
method and the entire jar file signed.
Since we use the same main()
for more than one
application and each application has a separate .jnlp
file, it is necessary to create a separate java class and jar file for each
application. Those jar files are found in
$PTII/ptolemy/actor/gui/jnlp
.
java.io.FileNotFoundException: JAR entry doc/mainVergil.htm not found in C:\Program Files\Java Web Start\.javaws\cache\file\D\P-1 \DMc&c\DMusers\DMcxh\DMptII\DMptolemy\RMptolemy.jar at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source) at sun.net.www.protocol.jar.JarURLConnection.getInputStream(Unknown Source) at javax.swing.JEditorPane.getStream(Unknown Source) at javax.swing.JEditorPane.setPage(Unknown Source) at ptolemy.actor.gui.HTMLViewer.setPage(HTMLViewer.java:195) at ptolemy.actor.gui.HTMLViewerTableau$Factory.createTableau(HTMLViewerTableau.java:169) at ptolemy.actor.gui.TableauFactory.createTableau(TableauFactory.java:116) at ptolemy.actor.gui.Configuration.createPrimaryTableau(Configuration.java:151) at ptolemy.actor.gui.Configuration.openModel(Configuration.java:267) at ptolemy.actor.gui.HTMLViewer.hyperlinkUpdate(HTMLViewer.java:139) at javax.swing.JEditorPane.fireHyperlinkUpdate(Unknown Source)
http://forums.java.sun.com/thread.jsp?forum=38&thread=71621
says:
I had this problem several months back and putting the following line (I put this code early in Jbinit() ): ClassLoader loader=this.getClass().getClassLoader(); Thread.currentThread().setContextClassLoader(loader); hope this helps, mdURLClassLoader fails when a URL points to a JAR inside another JAR
It turns out that is is necessary to modify Ptolemy II so that if
it is looking for a resource and fails then we should try stripping
out the text before the jar URL !/
separator and look
for the resource in the classpath.
Another thing to look for is hrefs that are relative and use
../
instead of ptolemy/
. Relative URLS
will not work when looking for resources using the classpath
cd $PTII; make jnlp_verify
jar -tvf file.jar
to verify that the
file actually has data files in it
cd $PTII; make jnlp_clean jnlp_all
cd $PTII; make clean install
Bad MIME type returned from server when accessing resource: http://www.gigascale.org/ptolemy/src/ptII/vergil.jnlp - text/htmlI think the problem is with the second time the jnlp file is fetched.
vergil.jnlp
file has spaces in it. The workaround is
to place your Ptolemy II tree in a directory that does not have spaces
in the path name if you plan on using Web Start.