> Hi
>
> I have a java program that has compiled and I have a game.java file.
> This runs fine by entering manually into the terminal and running it
> that way. However is there a way to execute it by just double clicking
> it to open the java program?
You need to create an executable JAR file.
A JAR file is a Java ARchive, much like a zip file, that bundles all of
the files that make up your program. JAR files are created with the "jar"
command line tool.
An executable JAR file is one that has a file called MANIFEST.MF in a
directory called META-INF. The manifest must include a property called
"Main-Class" that gives the fully qualified name of the class with the
main method.
Google should be able to provide plenty of examples.
Once you have created an executable JAR file, your program should run by
double-clicking on it.
Dan.

Signature
Daniel Dyer
https://watchmaker.dev.java.net - Evolutionary Algorithm Framework for Java
Andrew Thompson - 27 Dec 2006 01:22 GMT
...
> > I have a java program that has compiled and I have a game.java file.
> > This runs fine by entering manually into the terminal and running it
> > that way. However is there a way to execute it by just double clicking
> > it to open the java program?
...
> Once you have created an executable JAR file, your program should run by
> double-clicking on it.
But in addition to that, I would recommend taking it
one step further and launch the Jar using web-start.
Using web-start launch, you can suggest* to the
user that a desktop icon and menu item be created
as well. (* the user can refuse it, as they wish, and/or
change their minds later and establish an icon for it).
For web-start launch the code would need to be signed,
if it requires extended privileges. But even that is not
necessary, if it can run in a sandbox.
Andrew T.