it is possible to create a jar-file with some statement in it to define the startup class. doubleclickin the jar-file executes the specified class.
How its done precisely i can tell you tomorrow (about 10 hours after this post)
Well, a jar file isn't an executable - it cannot be run on it's own and most setups open it with winzip/winrar or not at all instead of running it (which requires a virtual machine installed, which isn't always the case either). A jar file is essentially a zip file with some extra internal structure-interpretation added.
Originally posted by liorean Well, it's a good way of packaging a java application, but it can't be run on it's own
Nobody here was arguing that it couldn't be run on it's own. Of course it needs the JVM installed. That is what makes java so portable.
Originally posted by liorean and is not by default run by a java virtual machine in win95 through win2k at least.
Last time I worked with jar files I seem to recall that you only needed to double click on the jar file to start up your application. And that was on several different versions of MS Windows. No file associations needed to be made. With the JDK installed the jar files will be run by the JVM.
Originally posted by liorean Besides, a file that can not be run natively in an OS without a parser, interpreter, compiler or virtual machine, is not an executable.
How do you figure that? Did you make up that definition of what an executable file is yourself?
Besides all of that you seem to be missing the whole point of weronpc's question. He just wants his friends to be able to run an application he wrote in Java. He can package it up into a jar file and then just ensure his friends have the JVM installed and then all they need to do is double click the jar file.
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!