This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 688

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: 10167
    
    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: 688

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: 10167
    
    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: 19651
    
  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: 10167
    
    8

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

Joined: Jul 03, 2011
Posts: 688

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: 19651
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make my game program run , just in double click ?
 
Similar Threads
how to create exe file
How to make jar file executeable ?
Problem running jar on new Windows 7 install
.class file into .exe file
Command Line from a jar