File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JNLP and Web Start and the fly likes how does it work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "how does it work" Watch "how does it work" New topic
Author

how does it work

Erwin Bredford
Ranch Hand

Joined: Feb 11, 2003
Posts: 167
i have been trying to use javastart for a while
now.
i want to know how you can
1.start java programs from desktop
2.the procedures in deploying my application
in simple english please.


--One learns a lot during a lesson but seeing is not enough,you must do;knowing is not enough ,you must apply--<br />SCJP 1.4,SCBCD,SCEA part 1,OCM JEE Enterprise Architect.
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy
You have several deployment options:
1) 100% local (executable jar)
2) part local, part remote (JWS, RMI)
3) 100% remote (Servlets, EJB)
1) Executable Jar:
- create a jar file with your application, which includes a manifest:
--create a manifest for the jar with an Main-Class entry, that says *which* class has the main method
Main-Class: MyClass
// don't say '.class' on the end
to MAKE the jar:
% jar -cmf myManifest.txt myApp.jar MyClass.class
- run the jar at the command-line, or create a script that will do this for you, so that when you execute the script, Java starts up and invokes the main method of the class in your jar.
% java -jar myJar.jar // this has your class with a main() in it

2). To use Web Start:
* Make an executable jar
* write a .jnlp file
* place your jar and your .jnlp file where they can be served by your web server
* add a new mime type to your web server
application/x-java-jnlp-file
* create a web page with a link to your .jnlp file
Note: the user MUST have Java Web Start (a helper application that of course requires Java) installed!
Assuming the user has Java Web Start installed (OS X ships with it already installed) it works very simply:
1) user clicks the HTML link
2) Web server serves back the jnlp file, with the appropriate mime-type header
3) browser reads the jnlp file and sees that it needs to hand it over to the Java Web Start on the user's machine
4) Java Web Start processes the jnlp file and gets the name and URL of the executable Jar
5) Java Web Start downloads the Jar and launches it (i.e. invokes the main method listed in the jar's manifest).
Of course, a gazillion things can go wrong, but that is the overview.
cheers,
Kathy
p.s. if you are looking for just 100% local deployment information, then probably the regular Java intermediate forum might be a good place to look.
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Just to add a detail:
here you have more information about how to create a jnlp file:
jnlp file syntax
[ April 28, 2003: Message edited by: Juanjo Bazan ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how does it work