aspose file tools*
The moose likes Java in General and the fly likes how to make my game program run  , just in double click ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to make my game program run  , just in double click ?" Watch "how to make my game program run  , just in double click ?" New topic
Author

how to make my game program run , just in double click ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

i have maked a tiny game program (a command line version ) what i want is that , only double click should start that game ..i have tried making jar and all but to execute that jar we have write a command on the terminal . which i dont want , what i want my file should be a executable so that whenever user double click on that in windows 7 , or xp that file should start running in terminal .
how to do that ? name any software which could help me ?


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10266
    
    8

The double click operation is associated with executables like javaw on the OS and have nothing to do with your code. If you associate it with java (instead of javaw) you will get the terminal window


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Maneesh Godbole wrote:The double click operation is associated with executables like javaw on the OS and have nothing to do with your code. If you associate it with java (instead of javaw) you will get the terminal window


i didnt get you .
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10266
    
    8

Rightclick on your executable jar. Select open with. You will see it is associated with javaw. Change it to java.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

But if you change the file association, java.exe will be used for all JAR files, adding a command prompt window for all Java applications.

I'd create a BATCH file and use that to launch the Java application.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10266
    
    8

True Rob. But the OP requires
only double click should start that game
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Rob Spoor wrote:But if you change the file association, java.exe will be used for all JAR files, adding a command prompt window for all Java applications.

I'd create a BATCH file and use that to launch the Java application.

but theres a problem , open with option has java platform se binary ...i didnt find anything like java ro javaw .
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

Maneesh Godbole wrote:True Rob. But the OP requires
only double click should start that game

Then he should double click the BATCH file instead.

naved momin wrote:
Rob Spoor wrote:But if you change the file association, java.exe will be used for all JAR files, adding a command prompt window for all Java applications.

I'd create a BATCH file and use that to launch the Java application.

but theres a problem , open with option has java platform se binary ...i didnt find anything like java ro javaw .

Use the option to browse for the application.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to make my game program run , just in double click ?