• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

clicking on jar icon

 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have two identical pc's at home: both winXPpro and connected with a home network. All this works fine.
I just installed jvm in my children's machine. I put there a jar file, and at first the icon wasnt the usual (with the A capital letter). I clicked and... nothing. Then asked for me to choose a program to open it.
First i made a bat file and that way i could open the jar.
Then i added jvm to System Path and choosed "java" to open the .jar, but without success either.

What exactly do i have to do in order to have the .jar opening just from clicking on it?
Thanks in advance
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd guess that your operating system file association for JAR files isn't configured correctly to be able to just double-click on a JAR file to get it to run. Are you familiar with changing file associations in Windows XP?

To do so, open any explorer (that's explorer, not Internet Explorer) window. In the "Tools" menu, select "Folder Options...". In the "Folder Options" window, select the "File Types" tab. If you've already an association for files with the .jar extension, then you may want to edit it; otherwise, create a new one for files with the .jar extension.

On my Windows XP Pro system, for files of with the .jar extension, the default action is named "open", and the application used to perform the action is

"D:\PATH_TO_MY_JRE\bin\javaw.exe" -jar "%1" %*

Use DDE is selected.

You could use java.exe instead of javaw.exe to run your JAR files. With java.exe, the running JAR will be associated with a displayed console window. With javaw.exe, no console window will be displayed.

Success?
[ June 12, 2004: Message edited by: Dirk Schreckmann ]
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
thanks for your help
i did what you said but i get an error msg saying:
could not find main class. Program will exit
I made the opening program java/.../bin/javaw
dont get it.
I also reinstaled jre.
But if i use my bat file my jar opens ok
What might been happening?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do the contents of your bat file look like?
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just like this:
cd c:\
java -jar Relatorio.jar
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you copy and paste the exact contents of your manifest here?

Also, have you looked inside the JAR to double check that the specified main class is present and correctly spelled?

Also, you can email me the JAR file, if you like, and I could just confirm whether it works for me. My email address is dirk AT javaranch DOT com
[ June 13, 2004: Message edited by: Dirk Schreckmann ]
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my manifest file:

Manifest-Version: 1.2
Main-Class: relatorio.Visual

I'm gonna give it another try when back from work
the jar has 20Mb (has all dependent hibernate files with it) and since it works fine if i start it from command line (in my case form msdos or with a bat file)
i guess maybe some prob with jre because the first install gave an error
Anyway thanks a lot for your interest and help
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm even more troubled and puzzled!
at office i've one machine win 2000 server - here the jar works when one clicks on it!
in another machine:winXPPro... its just like at home: cant find main class and only works from commandline/bat file
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen this problem arise on Windows machines with registry configuration problems related to the JRE installation. I have hacked the registry to fix the problem. So, it can be done, but I don't necessarily recommend it. (I recall doing a lot of searching for text such as "1.4" and "1.5").

The problem might fix itself, if you uninstall all JREs and J2SDKs from the machine, and then install one. I'd certainly restart after uninstalling, and before the new installation.
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot for your ideas!
i'll certainly try it as soon as i can, and then i'll post back to tell the results... which i hope will be great
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i followed your ideas:
uninstalled jvm,
rebooted,
installed again, BUT the offline version,
now, when that finished, i went to sun java webpage for testing the install (they have an applet to that effect) and the applet woorked ok
Now i tested my jar and....
I'm anxious to get home and try there too
thanks!
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i did it again at home
and worked too
thanks a lot again
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great!
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tx!
well, it wasnt without anxiety, because i'd to use the dde trick
 
reply
    Bookmark Topic Watch Topic
  • New Topic