File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes problem in starting the app in double click Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "problem in starting the app in double click " Watch "problem in starting the app in double click " New topic
Author

problem in starting the app in double click

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 675

within netbeans i have clean and build my GUI app and i have placed the entire code for starting the app in a .bat file so that my client can double click and execute and when i click cmd also start with the app and closing the cmd also closes the app too
is there any other way so that i can make a file whatever so that i client can just double click to start the app ?


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

Joined: Jul 26, 2007
Posts: 8430

You got two options
1) Change it to javaw -jar .... (not really recommended)
2) Make sure your jar is self executable by defining the Main-Class attribute in the manifest file http://download.oracle.com/javase/tutorial/deployment/jar/appman.html
This will make your jar "executable". i.e. the user can double click the jar to launch the application (no need for the batch file)


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32599
    
    4
You may need to ensure you have a file association from .jar to the Java™ runtime, but that is often set up automatically by the operating system.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: problem in starting the app in double click
 
Similar Threads
can i make a program which start by double click like window application
Basic Questions :D
JavaToExe
how to run a java app without typing "java "
Launch App from Windows Explorer and Open File