aspose file tools*
The moose likes Java in General and the fly likes running application with double click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "running application with double click" Watch "running application with double click" New topic
Author

running application with double click

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Hi guys,

so far, all my applications are running through the command line. I creat a MS-DOS Batch file and I type the run command: java -cp myJar.jar myMain...

I wonder if there is a way to simply double click on an icon and run the application avoiding the batch file.

Anyone?

Thanx

Ppr
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
so far, all my applications are running through the command line. I creat a MS-DOS Batch file and I type the run command: java -cp myJar.jar myMain...

I wonder if there is a way to simply double click on an icon and run the application avoiding the batch file.


You can define Main-Class: myMain in jar file's manifest file and then change the propereties of jar file to open it with java. Specify the location of java in path & anyother classes or jar files used by jar fiel to be executed- in classpath variables(environment variable in Control Panel of Window).
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
thanks looks like a good solution. I'll do that.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: running application with double click