Executable Jar? - Googled for hours, tried many solns, still doesn't work!

I am fairly new to Java, and I'm just simply trying to create an executable jar that will run when I double-click on the icon.
I have created my very basic program that uses java swing on Netbeans. I have right-clicked on the project, selected properties, and checked the packaging section to make sure that it creates a jar file. I also selected compress jar file, which some tutorial told me to do as well. (I've also tried not checking compress jar file to see if it made a difference... it didn't).
I then went to folder options to make an association with the jar file to javaw.exe so that when I clicked on the icon, it would know to use javaw.exe to open it. When I double click on the jar file, it now just makes the error noise and nothing happens. Before I made the assocation, it would open up ultimatezip which would show me the original source code, the class file, and the manifest.mf file.
In any event, I'm just playing around with creating an executable jar file and any advice on how to make it so that the GUI launches when I double click on it would be extremely helpful.
Edited by: bigbamboo on Oct 13, 2009 8:41 AM

bigbamboo wrote:
Thanks for your prompt response. I just tried your suggestions. 1 & 2 both worked for me. I have fiddled around some more with my file association and have looked at several sites that go through it step-by-step and I have tried them all. I went to tools, folder options, and I have changed the association to javaw.exe
I just can't figure out what's wrong.Good. So at least you know that it is the file type association that is not working correctly.
On my Windows PC, when I edit the open Action for .jar files, the command string is
"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*Maybe that will help. Of course, the path to your javaw.exe may be different.

Similar Messages

Maybe you are looking for