Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Publishing a java "executable"

 
Castor Tack
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all:

I know that it's technically wrong to say "executable" for a java application. But, how can I publish an application?

Say, I've written a project in java, and it has multiple files. I compile it, and have .class files. I then run the .class files, I see the application launched. But is there any way to convert (or whatever) all the .class files into one file(for instance, a .jnlp file) so that people can run it directly using jvm?

An example would be this:
http://download.oracle.com/javase/tutorial/uiswing/examples/components/index.html#Converter


When you click "launch", a jnlp file is actually downloaded or run, depending on user's choice. How can I make my project into a similar form so that people can directly run it from my site?

Thanks for any inputs.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4511
271
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Castor Tack wrote:...is there any way to convert (or whatever) all the .class files into one file(for instance, a .jnlp file) so that people can run it directly using jvm?


A JAR file can do that. Particularly, if Main-Class attribute is specified in MANIFEST.MF file of the JAR, you can specify which class to be executed at the first place.

JNLP is a protocol used for distributing Java Web Start applications. That is useful especially when you distribute your application over the web. Have a look at this tutorial for more details of creating Java Web Start applications
 
Castor Tack
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, man!
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15367
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This explains how to make an executable JAR: Packaging Programs in JAR Files
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic