Instead of messing with a script, package the classes in a jar file that you make double-clickable (by using the Main-Class attribute in the manifest). That will automatically start the JVM and run the main class.
It's worth noting, though, that embedding other jars within your jar, and using them from your executable jar is not easy or well supported. If you need to do this, I would suggest looking for another solution. (app packager of some kind)
Originally posted by Ulf Dittmer: I don't fully understand what Andre is saying, but let's not get sidetracked by jar files. They can easily be incorporated into the application jar file by unjaring/rejaring.
That's what I tried to say Jars rocks (but some people just make their reputation looks like shit because they don't really know how to use them. I'm sorry but I'm a little bad with english :|).
To make installation easy (so that your users don't have to manually download and install a JRE), you could use one of these installer generators to generate an installation program. Some of those in the list can automatically download and install a JRE if the user doesn't have it (or doesn't have the right version for your application).
You could also use Webstart (but your users will need to have Java already installed to use that). [ July 14, 2008: Message edited by: Jesper Young ]