• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

open Cmd program by double click

 
Marco Galea
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,

I exported my project into a .jar using eclipse. The problem or question I have is, if it is possible to make my program (which runs on the cmd) by just double clicking on the jar file. Cause at the moment i have to run it by opening the cmd myself, go the directory of the jar and input "java -jar myproj.jar"

Thanks in advance
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create a batch file (under Windows) or a shell script (*nix) that you can use to run your console application. E.g., for Windows:

Save it under a name with .bat extension, and you'll have the desired result - double click on this file will run your application.
 
Marco Galea
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kemal Sokolovic wrote:You can create a batch file (under Windows) or a shell script (*nix) that you can use to run your console application. E.g., for Windows:

Save it under a name with .bat extension, and you'll have the desired result - double click on this file will run your application.


Worked Great Thank you very much
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome!
 
Tony Docherty
Bartender
Posts: 2988
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Under Windows you can also associate files of type .jar with java.exe and then you can double click the jar to get it to run.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic