File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes jar on double clicking? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jar on double clicking?" Watch "jar on double clicking?" New topic

jar on double clicking?

bala chidambaram

Joined: Jan 19, 2004
Posts: 24
hello friend
I able to create a jar file in java as guidance provided by 'dirk'(thank u dirk). i can execute it in command line but find nothing on 'double click'(no error message). suggestions are welcome.
thank u
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
does your app run from command line or else has graphical interface?
because if the first is true then you'll see nothing, as a matter of a fact

java amateur
bala chidambaram

Joined: Jan 19, 2004
Posts: 24
thank u miguel for ur response.
I tried with two programs, one is about invoking a 'frame' and other is simple one carries 'System.out.println("...");'. both are working with
the command as follows.

>java -jar mainclass.txt jarfile.jar
suggestions are welcome.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Assumed you're running a kinda windows.
There is a MenuOption in Explorer 'Datatypes'.
Here you have to tell Windows, what you want to do, by hitting enter on a 'jar'-File.
Describe '.jar'-extension as Java-Archive, and define the program to execute, someting similar to 'java -jar %*%'.
Have a look at other entrys like 'html' 'doc' etc., to find out about the details.
bala chidambaram

Joined: Jan 19, 2004
Posts: 24
I cannot understand what do u say,Stefan.plz help me to understand.
thank u.
himanshu patel
Ranch Hand

Joined: Feb 03, 2003
Posts: 205
see this link ,
Follow paragraph titled , "To make jar files executable (Windows 98): ".

If you want to become a rich, do not work for others but make others to work for you.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Your likely problem is that your operating system isn't properly configured to run a JAR file when double-clicking on it.
If it helps, my settings for this file type are as follows.
"D:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe" -jar "%1" %*
If you need help on configuring your system to handle files with the .jar extension differently, just ask.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Consider Paul's rocket mass heater.
subject: jar on double clicking?
It's not a secret anymore!