Reputation: 469
Need to export clickable and executable file in eclipse. Simple exporting does not launch the program. How to get a clickable jar?
Upvotes: 0
Views: 1370
Reputation: 5282
The code listing represents a command prompt application; you can only make it do anything when physically run on the command prompt / shell itself, especially because it expects user input that way. The reason why turning the given program into an executable jar will result in "nothing" happening when you double click it, is because under Windows the default binding for the 'jar' filetype will be setup to run through javaw.exe - and javaw.exe is designed to not open up any command prompt.
In order to make a program be able to run without the command prompt so you only have to double click on it, you will need to get rid of the command prompt interface and instead build a proper graphical user interface, using for example JavaFX or Swing.
Upvotes: 0
Reputation: 4180
You should click file
, then click export
, then click java
and save it as runnable jar file
.
To run the .jar
file, open cmd or terminal, make sure you are in the right path and
type java -jar <jar-file-name>.jar
Note if you cant run it, mostly its your file path not correct
Upvotes: 2
Reputation: 56
Try to go in brief using the below link : http://www.wikihow.com/Create-an-Executable-File-from-Eclipse
Upvotes: 0