• Post Reply Bookmark Topic Watch Topic
  • New Topic

how does it work  RSS feed

Erwin Bredford
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have been trying to use javastart for a while
i want to know how you can
1.start java programs from desktop
2.the procedures in deploying my application
in simple english please.
Kathy Sierra
Cowgirl and Author
Posts: 1589
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
* 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.
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
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!