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.
You can try downloading Ptolemy II as a Web Start application
by going to
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII2.0/webstart.htm
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 one installs Web Start itself and then restarts your browser and downloads the Web Start enabled application.
You need to Install Web Start from Sun before installing . . .
http://java.sun.com/cgi-bin/javawebstart-platform.sh?
c:\Program Files\Java Web Start
is fine
Claudius Ptolemaus
is unknown.
You should hit the OK
button to proceed with the download
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
http://java.sun.com/products/java-media/3D/download.html
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\j2re1.4.2
This value is the JRE that Java 3D should be installed in.
File
-> Preferences
-> Java
and look at the command column of the table. The Ptolemy II
Web Start edition will use a JVM that is 1.4 or later.
A quick test is to click on one of the Vergil downloads and if you have Java Web start installed, either:
The Java Web Start FAQ at
http://java.sun.com/products/javawebstart/faq.html#11
says:
What are the supported browsers? JavaTM Web Start supports primarily Internet Explorer 4 or higher and Netscape 4.X. However JNLP files can be launched from any browser if the mime-type association is done correctly. Please note that JavaTM Web Start uses the browsers settings and may launch a browser to show a URL these may/may not work with unsupported browsers.JavaTM Web Start works with Netscape 6. However, you will manually need to register JavaTM Web Start with NS6. This is done in the Navigator/Applications section of the Navigator/Helper Application section. This will be done automatically in a later version of the JavaTM Web Start installer. back to top
http://java.sun.com/cgi-bin/javawebstart-platform.sh?
Edit -> Preferences
Navigator
in the left hand Category
pane
Helper Applications
application/x-java-jnlp-file
should
be listed. If it is, you are done, click on OK
application/x-java-jnlp-file
was not
listed, click on New Type
Description of type:
Java Web Start
File extension:
JNLP
MIME Type:
application/x-java-jnlp-file
Application to use
javaws.exe
binary, usually
c:\Program Files\Java Web Start\javaws.exe
OK
to close the New Type
window
OK
to close the Preference
window
Drive not Ready . . . Abort Retry CancelUpgrading to Java 1.3.1-02 seems to help
For more information, see
$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.