• Post Reply Bookmark Topic Watch Topic
  • New Topic

open Cmd program by double click  RSS feed

 
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
 
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!
 
Bartender
Posts: 3315
86
  • 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.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!