Skip to main content

New cd installation import facility

3 replies [Last post]
johnnypoll
Offline
Joined: 2010-10-28
Points: 0

With Java 5 I see JaWS has an Import Facility. However, I can't find instructions on how this works in the Developer's Guide or elsewhere. Has anyone done this / found the documentation?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cheran
Offline
Joined: 2005-08-12
Points: 0

HI,
You have to use the "-codebase " option along with the application URL, for loading the app using cdinstall you need to have the application resources locally.

When you are giving the -codebase option, javaws will load the applications resources from the resource location you have passed along with the -codebase option instead of downloading it from the codebase specified in the jnlp file.

For Ex:
http://java.sun.com/products/javawebstart/apps/notepad.jnlp this application requires notepad.jar as resource

Just copy the notepad.jar file locally and give the following command to load the app using cdinstall instead from the webserver.

${JRE_BIN}/javaws -codebase c:\temp -import http://java.sun.com/products/javawebstart/apps/notepad.jnlp

Please refer this page for syntax:
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/javaws....

-cheran

johnnypoll
Offline
Joined: 2010-10-28
Points: 0

This is a very useful looking explanation and the best I have come across. The developers guide doesn't appear to help. Unfortunately I'm not quite there. Using -import c:\temp I get a launch failure due to unexpected protocol: c

So I tried with -import file//C:\temp

which gets further, the Checking for latest version screen appears then an "Unable to import..." message. The General error comes up with "Unable to load resouce http://217.112.89.XXX/MP3/MP3.jnlp (I put in XXX)", then in Wrapped Exception I see UnknownHostException: C

This seems to suggest it is trying to interpret the C after file:// as a hostname.

John

dietz
Offline
Joined: 2005-08-01
Points: 0

OK:

first, you need to be importing a jnlp file, such as:
"javaws -import c:\temp\app.jnlp"
second, if you use the file protocol, the syntax would be:
"javaws -import file://C\:/temp/app.jnlp"
(you need to use forward slashes in a URL, and escape any colon "/:" for ":")

you really usually don't need the "-codebase" arg when importing, unless either
1.) the target jnlp file points to a codebase that is not curently accessable (because javaws will check with it for an update)., or
2.) the target jnlp file is not in the root of the codebase. (example "javaws -import c:\temp\jnlpfiles\app.jnlp -codebase file://C\:/temp")

/Dietz