Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Executable Jar

 
Brian Yingling
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've created a executable Jar file on Windows XP. While I can execute the jar file at the command line (java -jar foo.jar) I can't seem to have the file execute when double-clicking on the icon. I haven't been able to figure out the problem. Can anyone help me?
Thanks.
-Brian
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd guess that the file associations that your operating system is using for .jar files aren't configured properly to be able to run execute a JAR by double-clicking on it.
You can try to configure this setting manually, or you could try to remove the file association completely and then reinstall the JRE or J2SDK.
My setting, which works for me, for the action to take when double-clicking a JAR file is
"D:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe" -jar "%1" %*
If you need more detailed help on changing this setting, just ask.
[ February 15, 2004: Message edited by: Dirk Schreckmann ]
 
Brian Yingling
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dirk,
I've removed the file association and reinstalled the JDK and it still doesn't work. Here's the path associated with the Jar file:
"C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe" -jar "%1" %*
Thanks for your help, but I'm not sure what else to do. I'm at a loss.
--Brian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic