• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make a jar pop-up console ?  RSS feed

 
Quiddo Quitch
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know about ...

java -jar myProgram.jar

but is there a way where the user just double click the jar file, and the console pop-ups with the running program ?

if not ...

is there a way to include for example a picture in a .class archive ?

thank you
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is operating system dependent. I know on Windows you need to set the file association for .jar to java or java.exe with control panel->folder options or similar. Whenever I have tried it on Windows it seemed to work straight away regardless.

Not sure on other operating systems.
 
Victor Ewert
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my Ubuntu Linux (Gnome), if I right-click on the .jar file in Nautilus, and go to Properties, there is a tab called "Open With". I can select the Java Runtime, and then after that, if I double click the .jar it will run the application.
 
Matthew Cox
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Easiest way I have found is to use a IDE that provides the built-in functionality for creating an executable jar file of your project. Both NetBeans & BlueJ offer this functionality.


OR Create your own program since it can be done on the java cmd line and Java libraries contain the necessary APIs to code a program that could create executable jar files of your project.
 
Victor Ewert
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used Launch4j to wrap jar files into .exe files for windows, and have been pretty happy with it.

Victor Ewert
Ewert Technologies
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!